iOS 网络请求(AFNetworking)失败的错误码分析

NSError codes in the Cocoa error domain.

enum {
   <a target=_blank href="http://blog.csdn.net/linkai5696/article/details/5983384#//apple_ref/doc/c_ref/NSFileNoSuchFileError" style="color: rgb(51, 102, 204); text-decoration: none;">NSFileNoSuchFileError</a> = 4,
   <a target=_blank href="http://blog.csdn.net/linkai5696/article/details/5983384#//apple_ref/doc/c_ref/NSFileLockingError" style="color: rgb(51, 102, 204); text-decoration: none;">NSFileLockingError</a> = 255,
   <a target=_blank href="http://blog.csdn.net/linkai5696/article/details/5983384#//apple_ref/doc/c_ref/NSFileReadUnknownError" style="color: rgb(51, 102, 204); text-decoration: none;">NSFileReadUnknownError</a> = 256,
   <a target=_blank href="http://blog.csdn.net/linkai5696/article/details/5983384#//apple_ref/doc/c_ref/NSFileReadNoPermissionError" style="color: rgb(51, 102, 204); text-decoration: none;">NSFileReadNoPermissionError</a> = 257,
   <a target=_blank href="http://blog.csdn.net/linkai5696/article/details/5983384#//apple_ref/doc/c_ref/NSFileReadInvalidFileNameError" style="color: rgb(51, 102, 204); text-decoration: none;">NSFileReadInvalidFileNameError</a> = 258,
   <a target=_blank href="http://blog.csdn.net/linkai5696/article/details/5983384#//apple_ref/doc/c_ref/NSFileReadCorruptFileError" style="color: rgb(51, 102, 204); text-decoration: none;">NSFileReadCorruptFileError</a> = 259,
   <a target=_blank href="http://blog.csdn.net/linkai5696/article/details/5983384#//apple_ref/doc/c_ref/NSFileReadNoSuchFileError" style="color: rgb(51, 102, 204); text-decoration: none;">NSFileReadNoSuchFileError</a> = 260,
   <a target=_blank href="http://blog.csdn.net/linkai5696/article/details/5983384#//apple_ref/doc/c_ref/NSFileReadInapplicableStringEncodingError" style="color: rgb(51, 102, 204); text-decoration: none;">NSFileReadInapplicableStringEncodingError</a> = 261,
   <a target=_blank href="http://blog.csdn.net/linkai5696/article/details/5983384#//apple_ref/doc/c_ref/NSFileReadUnsupportedSchemeError" style="color: rgb(51, 102, 204); text-decoration: none;">NSFileReadUnsupportedSchemeError</a> = 262,
   <a target=_blank href="http://blog.csdn.net/linkai5696/article/details/5983384#//apple_ref/doc/c_ref/NSFileReadTooLargeError" style="color: rgb(51, 102, 204); text-decoration: none;">NSFileReadTooLargeError</a> = 263,
   <a target=_blank href="http://blog.csdn.net/linkai5696/article/details/5983384#//apple_ref/doc/c_ref/NSFileReadUnknownStringEncodingError" style="color: rgb(51, 102, 204); text-decoration: none;">NSFileReadUnknownStringEncodingError</a> = 264,
   <a target=_blank href="http://blog.csdn.net/linkai5696/article/details/5983384#//apple_ref/doc/c_ref/NSFileWriteUnknownError" style="color: rgb(51, 102, 204); text-decoration: none;">NSFileWriteUnknownError</a> = 512,
   <a target=_blank href="http://blog.csdn.net/linkai5696/article/details/5983384#//apple_ref/doc/c_ref/NSFileWriteNoPermissionError" style="color: rgb(51, 102, 204); text-decoration: none;">NSFileWriteNoPermissionError</a> = 513,
   <a target=_blank href="http://blog.csdn.net/linkai5696/article/details/5983384#//apple_ref/doc/c_ref/NSFileWriteInvalidFileNameError" style="color: rgb(51, 102, 204); text-decoration: none;">NSFileWriteInvalidFileNameError</a> = 514,
   <a target=_blank href="http://blog.csdn.net/linkai5696/article/details/5983384#//apple_ref/doc/c_ref/NSFileWriteInapplicableStringEncodingError" style="color: rgb(51, 102, 204); text-decoration: none;">NSFileWriteInapplicableStringEncodingError</a> = 517,
   <a target=_blank href="http://blog.csdn.net/linkai5696/article/details/5983384#//apple_ref/doc/c_ref/NSFileWriteUnsupportedSchemeError" style="color: rgb(51, 102, 204); text-decoration: none;">NSFileWriteUnsupportedSchemeError</a> = 518,
   <a target=_blank href="http://blog.csdn.net/linkai5696/article/details/5983384#//apple_ref/doc/c_ref/NSFileWriteOutOfSpaceError" style="color: rgb(51, 102, 204); text-decoration: none;">NSFileWriteOutOfSpaceError</a> = 640,
   <a target=_blank href="http://blog.csdn.net/linkai5696/article/details/5983384#//apple_ref/doc/c_ref/NSFileWriteVolumeReadOnlyError" style="color: rgb(51, 102, 204); text-decoration: none;">NSFileWriteVolumeReadOnlyError</a> = 642m
   <a target=_blank href="http://blog.csdn.net/linkai5696/article/details/5983384#//apple_ref/doc/c_ref/NSKeyValueValidationError" style="color: rgb(51, 102, 204); text-decoration: none;">NSKeyValueValidationError</a> = 1024,
   <a target=_blank href="http://blog.csdn.net/linkai5696/article/details/5983384#//apple_ref/doc/c_ref/NSFormattingError" style="color: rgb(51, 102, 204); text-decoration: none;">NSFormattingError</a> = 2048,
   <a target=_blank href="http://blog.csdn.net/linkai5696/article/details/5983384#//apple_ref/doc/c_ref/NSUserCancelledError" style="color: rgb(51, 102, 204); text-decoration: none;">NSUserCancelledError</a> = 3072,
   
   <a target=_blank href="http://blog.csdn.net/linkai5696/article/details/5983384#//apple_ref/doc/c_ref/NSFileErrorMinimum" style="color: rgb(51, 102, 204); text-decoration: none;">NSFileErrorMinimum</a> = 0,
   <a target=_blank href="http://blog.csdn.net/linkai5696/article/details/5983384#//apple_ref/doc/c_ref/NSFileErrorMaximum" style="color: rgb(51, 102, 204); text-decoration: none;">NSFileErrorMaximum</a> = 1023,
   <a target=_blank href="http://blog.csdn.net/linkai5696/article/details/5983384#//apple_ref/doc/c_ref/NSValidationErrorMinimum" style="color: rgb(51, 102, 204); text-decoration: none;">NSValidationErrorMinimum</a> = 1024,
   <a target=_blank href="http://blog.csdn.net/linkai5696/article/details/5983384#//apple_ref/doc/c_ref/NSValidationErrorMaximum" style="color: rgb(51, 102, 204); text-decoration: none;">NSValidationErrorMaximum</a> = 2047,
   <a target=_blank href="http://blog.csdn.net/linkai5696/article/details/5983384#//apple_ref/doc/c_ref/NSFormattingErrorMinimum" style="color: rgb(51, 102, 204); text-decoration: none;">NSFormattingErrorMinimum</a> = 2048,
   <a target=_blank href="http://blog.csdn.net/linkai5696/article/details/5983384#//apple_ref/doc/c_ref/NSFormattingErrorMaximum" style="color: rgb(51, 102, 204); text-decoration: none;">NSFormattingErrorMaximum</a> = 2559,
   
   <a target=_blank href="http://blog.csdn.net/linkai5696/article/details/5983384#//apple_ref/doc/c_ref/NSPropertyListReadCorruptError" style="color: rgb(51, 102, 204); text-decoration: none;">NSPropertyListReadCorruptError</a> = 3840,
   <a target=_blank href="http://blog.csdn.net/linkai5696/article/details/5983384#//apple_ref/doc/c_ref/NSPropertyListReadUnknownVersionError" style="color: rgb(51, 102, 204); text-decoration: none;">NSPropertyListReadUnknownVersionError</a> = 3841,
   <a target=_blank href="http://blog.csdn.net/linkai5696/article/details/5983384#//apple_ref/doc/c_ref/NSPropertyListReadStreamError" style="color: rgb(51, 102, 204); text-decoration: none;">NSPropertyListReadStreamError</a> = 3842,
   <a target=_blank href="http://blog.csdn.net/linkai5696/article/details/5983384#//apple_ref/doc/c_ref/NSPropertyListWriteStreamError" style="color: rgb(51, 102, 204); text-decoration: none;">NSPropertyListWriteStreamError</a> = 3851,
   <a target=_blank href="http://blog.csdn.net/linkai5696/article/details/5983384#//apple_ref/doc/c_ref/NSPropertyListErrorMinimum" style="color: rgb(51, 102, 204); text-decoration: none;">NSPropertyListErrorMinimum</a> = 3840,
   <a target=_blank href="http://blog.csdn.net/linkai5696/article/details/5983384#//apple_ref/doc/c_ref/NSPropertyListErrorMaximum" style="color: rgb(51, 102, 204); text-decoration: none;">NSPropertyListErrorMaximum</a> = 4095
   
   <a target=_blank href="http://blog.csdn.net/linkai5696/article/details/5983384#//apple_ref/doc/c_ref/NSExecutableErrorMinimum" style="color: rgb(51, 102, 204); text-decoration: none;">NSExecutableErrorMinimum</a> = 3584,
   <a target=_blank href="http://blog.csdn.net/linkai5696/article/details/5983384#//apple_ref/doc/c_ref/NSExecutableNotLoadableError" style="color: rgb(51, 102, 204); text-decoration: none;">NSExecutableNotLoadableError</a> = 3584,
   <a target=_blank href="http://blog.csdn.net/linkai5696/article/details/5983384#//apple_ref/doc/c_ref/NSExecutableArchitectureMismatchError" style="color: rgb(51, 102, 204); text-decoration: none;">NSExecutableArchitectureMismatchError</a> = 3585,
   <a target=_blank href="http://blog.csdn.net/linkai5696/article/details/5983384#//apple_ref/doc/c_ref/NSExecutableRuntimeMismatchError" style="color: rgb(51, 102, 204); text-decoration: none;">NSExecutableRuntimeMismatchError</a> = 3586,
   <a target=_blank href="http://blog.csdn.net/linkai5696/article/details/5983384#//apple_ref/doc/c_ref/NSExecutableLoadError" style="color: rgb(51, 102, 204); text-decoration: none;">NSExecutableLoadError</a> = 3587,
   <a target=_blank href="http://blog.csdn.net/linkai5696/article/details/5983384#//apple_ref/doc/c_ref/NSExecutableLinkError" style="color: rgb(51, 102, 204); text-decoration: none;">NSExecutableLinkError</a> = 3588,
   <a target=_blank href="http://blog.csdn.net/linkai5696/article/details/5983384#//apple_ref/doc/c_ref/NSExecutableErrorMaximum" style="color: rgb(51, 102, 204); text-decoration: none;">NSExecutableErrorMaximum</a> = 3839,
   
}
<h4 style="margin: 2em 0px 0.5em; padding: 0px; font-size: 16px; color: rgb(0, 0, 0);"><a target=_blank name="t2" style="color: rgb(51, 102, 153);"></a>URL Loading System Error Codes</h4><p class="abstract">These values are returned as the error code property of an <code style="font-size: 13px; color: rgb(102, 102, 102);">NSError</code> object with the domain “NSURLErrorDomain”.</p><pre class="declaration" name="code" style="white-space: pre-wrap; word-wrap: break-word;">typedef enum
{
   <a target=_blank href="http://blog.csdn.net/linkai5696/article/details/5983384#//apple_ref/doc/c_ref/NSURLErrorUnknown" style="color: rgb(51, 102, 204); text-decoration: none;">NSURLErrorUnknown</a> = -1,
   <a target=_blank href="http://blog.csdn.net/linkai5696/article/details/5983384#//apple_ref/doc/c_ref/NSURLErrorCancelled" style="color: rgb(51, 102, 204); text-decoration: none;">NSURLErrorCancelled</a> = -999,
   <a target=_blank href="http://blog.csdn.net/linkai5696/article/details/5983384#//apple_ref/doc/c_ref/NSURLErrorBadURL" style="color: rgb(51, 102, 204); text-decoration: none;">NSURLErrorBadURL</a> = -1000,
   <a target=_blank href="http://blog.csdn.net/linkai5696/article/details/5983384#//apple_ref/doc/c_ref/NSURLErrorTimedOut" style="color: rgb(51, 102, 204); text-decoration: none;">NSURLErrorTimedOut</a> = -1001,
   <a target=_blank href="http://blog.csdn.net/linkai5696/article/details/5983384#//apple_ref/doc/c_ref/NSURLErrorUnsupportedURL" style="color: rgb(51, 102, 204); text-decoration: none;">NSURLErrorUnsupportedURL</a> = -1002,
   <a target=_blank href="http://blog.csdn.net/linkai5696/article/details/5983384#//apple_ref/doc/c_ref/NSURLErrorCannotFindHost" style="color: rgb(51, 102, 204); text-decoration: none;">NSURLErrorCannotFindHost</a> = -1003,
   <a target=_blank href="http://blog.csdn.net/linkai5696/article/details/5983384#//apple_ref/doc/c_ref/NSURLErrorCannotConnectToHost" style="color: rgb(51, 102, 204); text-decoration: none;">NSURLErrorCannotConnectToHost</a> = -1004,
   <a target=_blank href="http://blog.csdn.net/linkai5696/article/details/5983384#//apple_ref/doc/c_ref/NSURLErrorDataLengthExceedsMaximum" style="color: rgb(51, 102, 204); text-decoration: none;">NSURLErrorDataLengthExceedsMaximum</a> = -1103,
   <a target=_blank href="http://blog.csdn.net/linkai5696/article/details/5983384#//apple_ref/doc/c_ref/NSURLErrorNetworkConnectionLost" style="color: rgb(51, 102, 204); text-decoration: none;">NSURLErrorNetworkConnectionLost</a> = -1005,
   <a target=_blank href="http://blog.csdn.net/linkai5696/article/details/5983384#//apple_ref/doc/c_ref/NSURLErrorDNSLookupFailed" style="color: rgb(51, 102, 204); text-decoration: none;">NSURLErrorDNSLookupFailed</a> = -1006,
   <a target=_blank href="http://blog.csdn.net/linkai5696/article/details/5983384#//apple_ref/doc/c_ref/NSURLErrorHTTPTooManyRedirects" style="color: rgb(51, 102, 204); text-decoration: none;">NSURLErrorHTTPTooManyRedirects</a> = -1007,
   <a target=_blank href="http://blog.csdn.net/linkai5696/article/details/5983384#//apple_ref/doc/c_ref/NSURLErrorResourceUnavailable" style="color: rgb(51, 102, 204); text-decoration: none;">NSURLErrorResourceUnavailable</a> = -1008,
   <a target=_blank href="http://blog.csdn.net/linkai5696/article/details/5983384#//apple_ref/doc/c_ref/NSURLErrorNotConnectedToInternet" style="color: rgb(51, 102, 204); text-decoration: none;">NSURLErrorNotConnectedToInternet</a> = -1009,
   <a target=_blank href="http://blog.csdn.net/linkai5696/article/details/5983384#//apple_ref/doc/c_ref/NSURLErrorRedirectToNonExistentLocation" style="color: rgb(51, 102, 204); text-decoration: none;">NSURLErrorRedirectToNonExistentLocation</a> = -1010,
   <a target=_blank href="http://blog.csdn.net/linkai5696/article/details/5983384#//apple_ref/doc/c_ref/NSURLErrorBadServerResponse" style="color: rgb(51, 102, 204); text-decoration: none;">NSURLErrorBadServerResponse</a> = -1011,
   <a target=_blank href="http://blog.csdn.net/linkai5696/article/details/5983384#//apple_ref/doc/c_ref/NSURLErrorUserCancelledAuthentication" style="color: rgb(51, 102, 204); text-decoration: none;">NSURLErrorUserCancelledAuthentication</a> = -1012,
   <a target=_blank href="http://blog.csdn.net/linkai5696/article/details/5983384#//apple_ref/doc/c_ref/NSURLErrorUserAuthenticationRequired" style="color: rgb(51, 102, 204); text-decoration: none;">NSURLErrorUserAuthenticationRequired</a> = -1013,
   <a target=_blank href="http://blog.csdn.net/linkai5696/article/details/5983384#//apple_ref/doc/c_ref/NSURLErrorZeroByteResource" style="color: rgb(51, 102, 204); text-decoration: none;">NSURLErrorZeroByteResource</a> = -1014,
   <a target=_blank href="http://blog.csdn.net/linkai5696/article/details/5983384#//apple_ref/doc/c_ref/NSURLErrorCannotDecodeRawData" style="color: rgb(51, 102, 204); text-decoration: none;">NSURLErrorCannotDecodeRawData</a> = -1015,
   <a target=_blank href="http://blog.csdn.net/linkai5696/article/details/5983384#//apple_ref/doc/c_ref/NSURLErrorCannotDecodeContentData" style="color: rgb(51, 102, 204); text-decoration: none;">NSURLErrorCannotDecodeContentData</a> = -1016,
   <a target=_blank href="http://blog.csdn.net/linkai5696/article/details/5983384#//apple_ref/doc/c_ref/NSURLErrorCannotParseResponse" style="color: rgb(51, 102, 204); text-decoration: none;">NSURLErrorCannotParseResponse</a> = -1017,
   <a target=_blank href="http://blog.csdn.net/linkai5696/article/details/5983384#//apple_ref/doc/c_ref/NSURLErrorFileDoesNotExist" style="color: rgb(51, 102, 204); text-decoration: none;">NSURLErrorFileDoesNotExist</a> = -1100,
   <a target=_blank href="http://blog.csdn.net/linkai5696/article/details/5983384#//apple_ref/doc/c_ref/NSURLErrorFileIsDirectory" style="color: rgb(51, 102, 204); text-decoration: none;">NSURLErrorFileIsDirectory</a> = -1101,
   <a target=_blank href="http://blog.csdn.net/linkai5696/article/details/5983384#//apple_ref/doc/c_ref/NSURLErrorNoPermissionsToReadFile" style="color: rgb(51, 102, 204); text-decoration: none;">NSURLErrorNoPermissionsToReadFile</a> = -1102,
   <a target=_blank href="http://blog.csdn.net/linkai5696/article/details/5983384#//apple_ref/doc/c_ref/NSURLErrorSecureConnectionFailed" style="color: rgb(51, 102, 204); text-decoration: none;">NSURLErrorSecureConnectionFailed</a> = -1200,
   <a target=_blank href="http://blog.csdn.net/linkai5696/article/details/5983384#//apple_ref/doc/c_ref/NSURLErrorServerCertificateHasBadDate" style="color: rgb(51, 102, 204); text-decoration: none;">NSURLErrorServerCertificateHasBadDate</a> = -1201,
   <a target=_blank href="http://blog.csdn.net/linkai5696/article/details/5983384#//apple_ref/doc/c_ref/NSURLErrorServerCertificateUntrusted" style="color: rgb(51, 102, 204); text-decoration: none;">NSURLErrorServerCertificateUntrusted</a> = -1202,
   <a target=_blank href="http://blog.csdn.net/linkai5696/article/details/5983384#//apple_ref/doc/c_ref/NSURLErrorServerCertificateHasUnknownRoot" style="color: rgb(51, 102, 204); text-decoration: none;">NSURLErrorServerCertificateHasUnknownRoot</a> = -1203,
   <a target=_blank href="http://blog.csdn.net/linkai5696/article/details/5983384#//apple_ref/doc/c_ref/NSURLErrorServerCertificateNotYetValid" style="color: rgb(51, 102, 204); text-decoration: none;">NSURLErrorServerCertificateNotYetValid</a> = -1204,
   <a target=_blank href="http://blog.csdn.net/linkai5696/article/details/5983384#//apple_ref/doc/c_ref/NSURLErrorClientCertificateRejected" style="color: rgb(51, 102, 204); text-decoration: none;">NSURLErrorClientCertificateRejected</a> = -1205,
   <a target=_blank href="http://blog.csdn.net/linkai5696/article/details/5983384#//apple_ref/doc/c_ref/NSURLErrorClientCertificateRequired" style="color: rgb(51, 102, 204); text-decoration: none;">NSURLErrorClientCertificateRequired</a> = -1206,
   <a target=_blank href="http://blog.csdn.net/linkai5696/article/details/5983384#//apple_ref/doc/c_ref/NSURLErrorCannotLoadFromNetwork" style="color: rgb(51, 102, 204); text-decoration: none;">NSURLErrorCannotLoadFromNetwork</a> = -2000,
   <a target=_blank href="http://blog.csdn.net/linkai5696/article/details/5983384#//apple_ref/doc/c_ref/NSURLErrorCannotCreateFile" style="color: rgb(51, 102, 204); text-decoration: none;">NSURLErrorCannotCreateFile</a> = -3000,
   <a target=_blank href="http://blog.csdn.net/linkai5696/article/details/5983384#//apple_ref/doc/c_ref/NSURLErrorCannotOpenFile" style="color: rgb(51, 102, 204); text-decoration: none;">NSURLErrorCannotOpenFile</a> = -3001,
   <a target=_blank href="http://blog.csdn.net/linkai5696/article/details/5983384#//apple_ref/doc/c_ref/NSURLErrorCannotCloseFile" style="color: rgb(51, 102, 204); text-decoration: none;">NSURLErrorCannotCloseFile</a> = -3002,
   <a target=_blank href="http://blog.csdn.net/linkai5696/article/details/5983384#//apple_ref/doc/c_ref/NSURLErrorCannotWriteToFile" style="color: rgb(51, 102, 204); text-decoration: none;">NSURLErrorCannotWriteToFile</a> = -3003,
   <a target=_blank href="http://blog.csdn.net/linkai5696/article/details/5983384#//apple_ref/doc/c_ref/NSURLErrorCannotRemoveFile" style="color: rgb(51, 102, 204); text-decoration: none;">NSURLErrorCannotRemoveFile</a> = -3004,
   <a target=_blank href="http://blog.csdn.net/linkai5696/article/details/5983384#//apple_ref/doc/c_ref/NSURLErrorCannotMoveFile" style="color: rgb(51, 102, 204); text-decoration: none;">NSURLErrorCannotMoveFile</a> = -3005,
   <a target=_blank href="http://blog.csdn.net/linkai5696/article/details/5983384#//apple_ref/doc/c_ref/NSURLErrorDownloadDecodingFailedMidStream" style="color: rgb(51, 102, 204); text-decoration: none;">NSURLErrorDownloadDecodingFailedMidStream</a> = -3006,
   <a target=_blank href="http://blog.csdn.net/linkai5696/article/details/5983384#//apple_ref/doc/c_ref/NSURLErrorDownloadDecodingFailedToComplete" style="color: rgb(51, 102, 204); text-decoration: none;">NSURLErrorDownloadDecodingFailedToComplete</a> = -3007
}

郑重声明:本站内容如果来自互联网及其他传播媒体,其版权均属原媒体及文章作者所有。转载目的在于传递更多信息及用于网络分享,并不代表本站赞同其观点和对其真实性负责,也不构成任何其他建议。