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

前端 未结 30 3469
悲哀的现实
悲哀的现实 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:48

    Also have a problem with beta 5 and AFNetworking 1.3 when running on iOS 8 simulator that results in a connection error:

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

    The same code works fine on iOS 7 and 7.1 simulators and my debugging proxy shows that the failure occurs before a connection is actually attempted (i.e. no requests logged).

    I have tracked the failure to NSURLConnection and reported bug to Apple. See line 5 in attached image:

    NSURLConnection client delegate did fail error.

    Changing to use https allows connection from iOS 8 simulators albeit with intermittent errors.

    Problem is still present in Xcode 6.01 (gm).

提交回复
热议问题