I am facing the below error:
{Error Domain=kCFErrorDomainCFNetwork Code=-1005 "The network connection was lost." UserInfo={NSErrorFailingURLStringKey=http://xxxxxx, NSErrorFailingURLKey=http://xxxxxx, _kCFStreamErrorCodeKey=-4, _kCFStreamErrorDomainKey=4, NSLocalizedDescription=The network connection was lost.}
I already referred some answers for same question, but I am failed to solve this issue.
- I checked internet connection.
- I checked resetting the simulator and some other ways
I am using AFNetworking
and the following code snippet to make the network call:
AFHTTPRequestOperationManager *manager = [AFHTTPRequestOperationManager manager];
manager.requestSerializer = [AFJSONRequestSerializer serializer];
[manager POST:url parameters:finalDict success:^(AFHTTPRequestOperation *operation, id responseObject) {
NSLog(@"JSON: %@",responseObject);
*********
*********
} failure:^(AFHTTPRequestOperation *operation, NSError *error) {
NSLog(@"Error: %@", error);
}
}];
I am using currently Xcode 7.2 and simulator 9.2. few answers in this site for the same issue I really not understood. Can anyone help me what is the issue about?