The greatest source of failure in iOS apps is networking. Between radios, transport, data roaming policies, proxies, security, authentication, and any number of protocol-specific negotiation, there is a lot that can go wrong.
On the plus side, the Foundation URL Loading system is incredibly mature, and takes care of most of that for you. The only negative is that the documentation for all of the various things that can go wrong is scattered across different programming guides and headers. If you get a request failing with error -1004, it can be surprisingly difficult to figure out exactly what that means.
As such, here is an exhaustive, well-formatted table at your disposal:
Code
Description
-1 NSURLErrorUnknown
1 kCFHostErrorHostNotFound
Indicates that the DNS lookup failed.
2 kCFHostErrorUnknown
An unknown error occurred (a name server failure, for example). For additional information, query the kCFGetAddrInfoFailureKey to get the value returned from getaddrinfo; lookup in netdb.h
100 kCFSOCKSErrorUnknownClientVersion
The SOCKS server rejected access because it does not support connections with the requested SOCKS version.Query kCFSOCKSStatusCodeKey to recover the status code returned by the server.
101 kCFSOCKSErrorUnsupportedServerVersion
The version of SOCKS requested by the server is not supported. Query kCFSOCKSStatusCodeKey to recover the status code returned by the server.
Query the kCFSOCKSVersionKey to find the version requested by the server.
SOCKS4 Errors
110 kCFSOCKS4ErrorRequestFailed
Request rejected or failed by the server.
111 kCFSOCKS4ErrorIdentdFailed
Request rejected because SOCKS server cannot connect to identd on the client.
112 kCFSOCKS4ErrorIdConflict
Request rejected because the client program and identd report different user-ids.
113 kCFSOCKS4ErrorUnknownStatusCode
The status code returned by the server is unknown.
SOCKS5 Errors
120 kCFSOCKS5ErrorBadState
The stream is not in a state that allows the requested operation.
121 kCFSOCKS5ErrorBadResponseAddr
The address type returned is not supported.
122 kCFSOCKS5ErrorBadCredentials
The SOCKS server refused the client connection because of bad login credentials.
123 kCFSOCKS5ErrorUnsupportedNegotiationMethod
The requested method is not supported. Query kCFSOCKSNegotiationMethodKey to find the method requested.
124 kCFSOCKS5ErrorNoAcceptableMethod
The client and server could not find a mutually agreeable authentication method.
FTP Errors
200 kCFFTPErrorUnexpectedStatusCode
The server returned an unexpected status code. Query the kCFFTPStatusCodeKey to get the status code returned by the server
HTTP Errors
300 kCFErrorHTTPAuthenticationTypeUnsupported
The client and server could not agree on a supported authentication type.
301 kCFErrorHTTPBadCredentials
The credentials provided for an authenticated connection were rejected by the server.
302 kCFErrorHTTPConnectionLost
The connection to the server was dropped. This usually indicates a highly overloaded server.
303 kCFErrorHTTPParseFailure
The HTTP server response could not be parsed.
304 kCFErrorHTTPRedirectionLoopDetected
Too many HTTP redirects occurred before reaching a page that did not redirect the client to another page. This usually indicates a redirect loop.
305 kCFErrorHTTPBadURL
The requested URL could not be retrieved.
306 kCFErrorHTTPProxyConnectionFailure
A connection could not be established to the HTTP proxy.
307 kCFErrorHTTPBadProxyCredentials
The authentication credentials provided for logging into the proxy were rejected.
308 kCFErrorPACFileError
An error occurred with the proxy autoconfiguration file.
309 kCFErrorPACFileAuth
The authentication credentials provided by the proxy autoconfiguration file were rejected.
310 kCFErrorHTTPSProxyConnectionFailure
A connection could not be established to the HTTPS proxy.
NSURLErrorDomain & CFNetworkErrorsThe greatest source of failure in iOS apps is networking. Between radios, transport, data roaming policies, proxies, security, authentication, and any number of p