nserror

HTTP status code 0 - Error Domain=NSURLErrorDomain?

|▌冷眼眸甩不掉的悲伤 提交于 2019-11-26 08:09:54
问题 I am working on an iOS project. In this application, I am downloading images from the server. Problem: While downloading images I am getting Request Timeout. According to documentation HTTP status code of request timeout is 408 . But in my application, I am getting HTTP status code 0 with the following error Error Domain=NSURLErrorDomain Code=-1001 \"The request timed out.\" UserInfo=0xb9af710 {NSErrorFailingURLStringKey= http://xxxx.com/resources/p/PNG/1383906967_5621_63.jpg ,

Objective-C Exceptions

不羁的心 提交于 2019-11-26 06:20:36
问题 I have just completed an iPhone app programming course. As part of the course, I saw Objective-C provides exception handling using the @try directive The system library does not use exception handling, preferring to return nil I asked if I should use exception handling for new code I wrote (e.g. if I write both the front-end and logic code, so the communication between them is in my hands) but I was told no, one should not use exceptions for new code. (But he failed to elaborate, then the