Error Domain=NSURLErrorDomain Code=-1005 “The network connection was lost.”

前端 未结 30 3057
悲哀的现实
悲哀的现实 2020-11-22 05:51

I have an application which works fine on Xcode6-Beta1 and Xcode6-Beta2 with both iOS7 and iOS8. But with Xcode6-Beta3, Beta4, Beta5 I\'m facing network issues with iOS8 but

30条回答
  •  遇见更好的自我
    2020-11-22 06:29

    On 2017-01-25 Apple released a technical Q&A regarding this error:

    Apple Technical Q&A QA1941

    Handling “The network connection was lost” Errors

    A: NSURLErrorNetworkConnectionLost is error -1005 in the NSURLErrorDomain error domain, and is displayed to users as “The network connection was lost”. This error means that the underlying TCP connection that’s carrying the HTTP request disconnected while the HTTP request was in progress (see below for more information about this). In some circumstances NSURLSession may retry such requests automatically (specifically, if the request is idempotent) but in other circumstances that’s not allowed by the HTTP standards.

    https://developer.apple.com/library/archive/qa/qa1941/_index.html#//apple_ref/doc/uid/DTS40017602

提交回复
热议问题