문제

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