Objective C : "The network connection was lost." Issue
Currently I am working on a project in which a device needs to be communicated with a Mac machine. W开发者_JAVA百科hen the device is connected to the Mac, an HTTP request will be sent to the device which will be handled by a CGI application on the device.
For that, I have created an NSURLConnection instance, which will send a request to the given CGI link.
But, the response which is supposed to be sent by the device is not received. Instead connection:didFailWithError method gets invoked. The error printed was as follows :
Error Domain=NSURLErrorDomain Code=-1005 UserInfo=0x114c76230 "The network connection was lost." Underlying Error=(Error Domain=kCFErrorDomainCFNetwork Code=-1005 UserInfo=0x114c79160 "The network connection was lost.")
What could be the problem?
i think it may be wi-fi problem once check your device network connectivity.i am not sure You can use reachability class for this issue
精彩评论