1

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.

  1. I checked internet connection.
  2. 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?

UdayM
  • 1,725
  • 16
  • 34
  • restart your simulator and check , for more deatails check this https://github.com/AFNetworking/AFNetworking/issues/2546 – Anbu.Karthik Apr 27 '16 at 10:43
  • @Anbu.Karthik : already i did that but no use – UdayM Apr 27 '16 at 10:44
  • ok check this once http://stackoverflow.com/questions/25372318/error-domain-nsurlerrordomain-code-1005-the-network-connection-was-lost – Anbu.Karthik Apr 27 '16 at 10:45
  • @Anbu.Karthik : already i checked that..but i not understood few answers..atleast say 1 thing ,is this issue related to app side or may be from server side, b'coz this is working from 1 month.but suddenly from yesterday i am facing this issue – UdayM Apr 27 '16 at 11:29
  • are you added the `LSApplicationQuerySchemes` in your plist – Anbu.Karthik Apr 27 '16 at 11:31
  • @Anbu.Karthik : not added...but upto my knowledge we will add LSApplicationQuerySchemes when we are using facebook SDK – UdayM Apr 28 '16 at 05:34
  • not like that bro , in ios 9 and above for connection purpose LSApplicationQuerySchemes needed – Anbu.Karthik Apr 28 '16 at 05:49
  • Possible duplicate of [Error Domain=NSURLErrorDomain Code=-1005 "The network connection was lost."](https://stackoverflow.com/questions/25372318/error-domain-nsurlerrordomain-code-1005-the-network-connection-was-lost) – ZachtheBoB Aug 11 '17 at 17:19

0 Answers0