我从AFNetworking得到了一个strage错误,即使请求似乎工作正常(因为实际上在网站上发生了变化).
Error Domain=NSURLErrorDomain Code=-999 "The operation couldn’t be completed (NSURLErrorDomain error -999.)" UserInfo=0x1fd4a080 {NSErrorFailingURLKey=http://gcm.greenlightdispatch.com/services/json/}
奇怪的是它返回了这个错误,但它实际上没有完成请求的问题(在服务器上,信息通过正常和所有).
AFHTTPClient *httpClient = [[[AFHTTPClient alloc] initWithBaseURL:url] autorelease]; [httpClient postPath:@"" parameters:[NSDictionary dictionaryWithDictionary:params] success:^(AFHTTPRequestOperation *operation,id responSEObject) { NSLog(@"Success: %@",[responSEObject objectFromJSONData]); } failure:^(AFHTTPRequestOperation *operation,NSError *error) { NSLog(@"Error: %@",error.description); }];
谢谢您的帮助
解决方法
之前已经多次回答过这个问题.该操作正在取消,这就是您收到该错误的原因.