سؤال

Is there any ways to systematically display the errors when did fail delegate is called in NSURLConnection delegate method?Is there any helper methods to find the associated error with error number returned by the delegate?

هل كانت مفيدة؟

المحلول

Read about NSError in Apple's documentation. It has certain properties and methods to give details of error/failures. Once you're good with this you can access the error object provided in the delegate method to know about the NSURLConnection failure.

Also, you can use object.description or object.debugDescription

If you want to see the common errors (i.e. understandable by laymen ), then just print error.localizedDescription. It will print something very simple as "Internet not available" etc. instead of giving you error codes, etc.

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top