1

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.

Amit Raj
  • 1,358
  • 3
  • 22
  • 47

1 Answers1

1

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.

Jakub Vano
  • 3,833
  • 15
  • 29
  • Thanks Jakub for your quick response. Do I need to handle each error code individually? – Amit Raj Jun 09 '15 at 09:35
  • Only the ones you need to handle in other than default way.. Also - errors have `localizedDescription` property, which can be used for displaying problem to the user.. – Jakub Vano Jun 09 '15 at 09:43