swiftnsurlconnectionxcode6.3nsurlerrordomain

Difference between a connection failed or no response in an https connection in iPhone


We have used NSURLConnection for establishing the connection with the server. Can we differentiate between a connection failed or no response received from the server in an https connection in iOS 8(Xcode 6.3)? If yes, then please help us with this.


Solution

  • NSURLConnectionDelegate method -connection:didFailWithError: provides you with error describing reason for failure. You can differentiate between situations based on error.code - list of codes here.