2

I am getting error -

Error: Domain=NSURLErrorDomain Code=-1005 "The network connection was lost.

UserInfo=0x10e74380 {NSLocalizedDescription=The network connection was lost.

I am facing the this error on devices. First request works very well. But when I put the data from the response of first request into second one, it always gives error -1005. This is happens in iOS 8 only. More than 100 users for our app reported this issue. Its happening on device and simulator both. We are using https , POST request. If I put the second request in place if first then it works. Which means problem occurs when I make the second request. Can we do anything from app side to fix this issue?

Dharmesh Kheni
  • 71,228
  • 33
  • 160
  • 165
  • What don't you understand about that message? – Droppy Oct 13 '14 at 09:02
  • 3
    Checkout the answers on another thread http://stackoverflow.com/questions/25372318/error-domain-nsurlerrordomain-code-1005-the-network-connection-was-lost?lq=1 – user3289219 Oct 15 '14 at 05:29
  • Hey have you solved this bugs. I am facing this same problem –  Nov 23 '15 at 13:49
  • @Bhumica Actually the data coming from server was too big to be handled by iPad. So we cut it down into to. And it started working fine. I am sure there would be some simple solution out there. But I couldn't find anything other than this. –  Dec 18 '15 at 07:24

1 Answers1

1

This is a bug in the implementation of the underlying NSURLclass which is found only in IOS 8 you have to either turn off keep alive flag in the server eg. for Apache: BrowserMatch "^iOS/8\." nokeepalive

or handle the error in your code and retry the request upon which it works.

Vivekanandan
  • 108
  • 1
  • 4