NSError code 错误列表信息

1.FoundationError

NS_ENUM(NSInteger) {/* File system and file I/O related errors, 
  with NSFilePathErrorKey or NSURLErrorKey containing path or URL*/
    NSFileNoSuchFileError = 4,                                              
    // Attempt to do a file system operation on a non-existent file
    NSFileLockingError = 255,                                              
    // Couldn't get a lock on file
    NSFileReadUnknownError = 256,                                           
    // Read error (reason unknown)
    NSFileReadNoPermissionError = 257,                                      
    // Read error (permission problem)
    NSFileReadInvalidFileNameError = 258,                                   
    // Read error (invalid file name)
    NSFileReadCorruptFileError = 259,                                       
    // Read error (file corrupt, bad format, etc)
    NSFileReadNoSuchFileError = 260,                                        
    // Read error (no such file)
    NSFileReadInapplicableStringEncodingError = 261,                        
    // Read error (string encoding not applicable) also NSStringEncodingErrorKey
    NSFileReadUnsupportedSchemeError = 262,                                 
    // Read error (unsupported URL scheme)
    NSFileReadTooLargeError NS_ENUM_AVAILABLE(10_5, 2_0) = 263,  
    // Read error (file too large)
    NSFileReadUnknownStringEncodingError NS_ENUM_AVAILABLE(10_5, 2_0) = 264, 
    // Read error (string encoding of file contents could not be determined)
    NSFileWriteUnknownError = 512,                                          
    // Write error (reason unknown)
    NSFileWriteNoPermissionError = 513,                                     
    // Write error (permission problem)
    NSFileWriteInvalidFileNameError = 514,                                  
    // Write error (invalid file name)
    NSFileWriteFileExistsError NS_ENUM_AVAILABLE(10_7, 5_0) = 516,  
     // Write error (file exists)
    NSFileWriteInapplicableStringEncodingError = 517,                       
    // Write error (string encoding not applicable) also NSStringEncodingErrorKey
    NSFileWriteUnsupportedSchemeError = 518,                                
    // Write error (unsupported URL scheme)
    NSFileWriteOutOfSpaceError = 640,                                       
    // Write error (out of disk space)
    NSFileWriteVolumeReadOnlyError NS_ENUM_AVAILABLE(10_6, 4_0) = 642,      
    // Write error (readonly volume)

    // NSFileManager unmount errors
    NSFileManagerUnmountUnknownError NS_ENUM_AVAILABLE(10_11, NA) = 768,    
    // The volume could not be unmounted (reason unknown)
    NSFileManagerUnmountBusyError NS_ENUM_AVAILABLE(10_11, NA) = 769,       
    // The volume could not be unmounted because it is in use

    // Other errors
    NSKeyValueValidationError = 1024,                                       
    // KVC validation error
    NSFormattingError = 2048,                                               
    // Formatting error
    NSUserCancelledError = 3072,                                            
    // User cancelled operation (this one often doesn't deserve a panel and might be a good one to special case)
    NSFeatureUnsupportedError NS_ENUM_AVAILABLE(10_8, 6_0) = 3328,          
    // Feature unsupported error

    // Executable loading errors
    NSExecutableNotLoadableError NS_ENUM_AVAILABLE(10_5, 2_0) = 3584,           
    // Executable is of a type that is not loadable in the current process
    NSExecutableArchitectureMismatchError NS_ENUM_AVAILABLE(10_5, 2_0) = 3585,  
    // Executable does not provide an architecture compatible with the current process
    NSExecutableRuntimeMismatchError NS_ENUM_AVAILABLE(10_5, 2_0) = 3586,       
    // Executable has Objective C runtime information incompatible with the current process
    NSExecutableLoadError NS_ENUM_AVAILABLE(10_5, 2_0) = 3587,  
    // Executable cannot be loaded for some other reason, such as a problem with a library it depends on
    NSExecutableLinkError NS_ENUM_AVAILABLE(10_5, 2_0) = 3588,   
    // Executable fails due to linking issues

    // Inclusive error range definitions, for checking future error codes
    NSFileErrorMinimum = 0,
    NSFileErrorMaximum = 1023,

    NSValidationErrorMinimum = 1024,
    NSValidationErrorMaximum = 2047,

    NSExecutableErrorMinimum NS_ENUM_AVAILABLE(10_5, 2_0) = 3584,
    NSExecutableErrorMaximum NS_ENUM_AVAILABLE(10_5, 2_0) = 3839,

    NSFormattingErrorMinimum = 2048,
    NSFormattingErrorMaximum = 2559,

    NSPropertyListReadCorruptError NS_ENUM_AVAILABLE(10_6, 4_0) = 3840,         
    // Error parsing a property list
    NSPropertyListReadUnknownVersionError NS_ENUM_AVAILABLE(10_6, 4_0) = 3841,  
    // The version number in the property list is unknown
    NSPropertyListReadStreamError NS_ENUM_AVAILABLE(10_6, 4_0) = 3842,          
    // Stream error reading a property list
    NSPropertyListWriteStreamError NS_ENUM_AVAILABLE(10_6, 4_0) = 3851,         
    // Stream error writing a property list
    NSPropertyListWriteInvalidError NS_ENUM_AVAILABLE(10_10, 8_0) = 3852,       
    // Invalid property list object or invalid property list type specified when writing

    NSPropertyListErrorMinimum NS_ENUM_AVAILABLE(10_6, 4_0) = 3840,
    NSPropertyListErrorMaximum NS_ENUM_AVAILABLE(10_6, 4_0) = 4095,

    NSXPCConnectionInterrupted NS_ENUM_AVAILABLE(10_8, 6_0) = 4097,
    NSXPCConnectionInvalid NS_ENUM_AVAILABLE(10_8, 6_0) = 4099,
    NSXPCConnectionReplyInvalid NS_ENUM_AVAILABLE(10_8, 6_0) = 4101,

    NSXPCConnectionErrorMinimum NS_ENUM_AVAILABLE(10_8, 6_0) = 4096,
    NSXPCConnectionErrorMaximum NS_ENUM_AVAILABLE(10_8, 6_0) = 4224,

    NSUbiquitousFileUnavailableError NS_ENUM_AVAILABLE(10_9, 7_0) = 4353, 
    // NSURLUbiquitousItemDownloadingErrorKey contains an error with this code when the item has not been uploaded to iCloud by the other devices yet
    NSUbiquitousFileNotUploadedDueToQuotaError NS_ENUM_AVAILABLE(10_9, 7_0) = 4354, 
    // NSURLUbiquitousItemUploadingErrorKey contains an error with this code when the item has not been uploaded to iCloud because it would make the account go over-quota
    NSUbiquitousFileUbiquityServerNotAvailable NS_ENUM_AVAILABLE(10_9, 7_0) = 4355, 
    // NSURLUbiquitousItemDownloadingErrorKey and NSURLUbiquitousItemUploadingErrorKey contain an error with this code when connecting to the iCloud servers failed

    NSUbiquitousFileErrorMinimum NS_ENUM_AVAILABLE(10_9, 7_0) = 4352,
    NSUbiquitousFileErrorMaximum NS_ENUM_AVAILABLE(10_9, 7_0) = 4607,

    NSUserActivityHandoffFailedError NS_ENUM_AVAILABLE(10_10, 8_0) = 4608, 
    // The data for the user activity was not available (e.g. if the remote device became unavailable.)
    NSUserActivityConnectionUnavailableError NS_ENUM_AVAILABLE(10_10, 8_0) = 4609,  
    // The user activity could not be continued because a required connection was not available
    NSUserActivityRemoteApplicationTimedOutError NS_ENUM_AVAILABLE(10_10, 8_0) = 4610, 
    // The remote application failed to send data in time
    NSUserActivityHandoffUserInfoTooLargeError NS_ENUM_AVAILABLE(10_10, 8_0) = 4611, 
    // The NSUserActivity userInfo dictionary was too large to receive

    NSUserActivityErrorMinimum NS_ENUM_AVAILABLE(10_10, 8_0) = 4608,
    NSUserActivityErrorMaximum NS_ENUM_AVAILABLE(10_10, 8_0) = 4863,

    NSCoderReadCorruptError NS_ENUM_AVAILABLE(10_11, 9_0) = 4864, 
    // Error parsing data during decode
    NSCoderValueNotFoundError NS_ENUM_AVAILABLE(10_11, 9_0) = 4865, 
    // Data requested was not found
    NSCoderErrorMinimum NS_ENUM_AVAILABLE(10_11, 9_0) = 4864,
    NSCoderErrorMaximum NS_ENUM_AVAILABLE(10_11, 9_0) = 4991,

    NSBundleErrorMinimum NS_ENUM_AVAILABLE(10_11, 9_0) = 4992,
    NSBundleErrorMaximum NS_ENUM_AVAILABLE(10_11, 9_0) = 5119,

    NSBundleOnDemandResourceOutOfSpaceError NS_ENUM_AVAILABLE(NA, 9_0) = 4992, 
    // There was not enough space available to download the requested On Demand Resources.
    NSBundleOnDemandResourceExceededMaximumSizeError NS_ENUM_AVAILABLE(NA, 9_0) = 4993, 
    // The application exceeded the amount of On Demand Resources content in use at one time
    NSBundleOnDemandResourceInvalidTagError NS_ENUM_AVAILABLE(NA, 9_0) = 4994, 
    // The application specified a tag which the system could not find in the application tag manifest
};

2.NSURLError

NS_ENUM(NSInteger) {
    NSURLErrorUnknown =                          -1,
    NSURLErrorCancelled =                        -999,
    NSURLErrorBadURL =                           -1000,
    NSURLErrorTimedOut =                         -1001,
    NSURLErrorUnsupportedURL =                   -1002,
    NSURLErrorCannotFindHost =                   -1003,
    NSURLErrorCannotConnectToHost =              -1004,
    NSURLErrorNetworkConnectionLost =            -1005,
    NSURLErrorDNSLookupFailed =                  -1006,
    NSURLErrorHTTPTooManyRedirects =             -1007,
    NSURLErrorResourceUnavailable =              -1008,
    NSURLErrorNotConnectedToInternet =           -1009,
    NSURLErrorRedirectToNonExistentLocation =    -1010,
    NSURLErrorBadServerResponse =                -1011,
    NSURLErrorUserCancelledAuthentication =      -1012,
    NSURLErrorUserAuthenticationRequired =       -1013,
    NSURLErrorZeroByteResource =                 -1014,
    NSURLErrorCannotDecodeRawData =              -1015,
    NSURLErrorCannotDecodeContentData =          -1016,
    NSURLErrorCannotParseResponse =              -1017,
    NSURLErrorAppTransportSecurityRequiresSecureConnection
                 NS_ENUM_AVAILABLE(10_11, 9_0) = -1022,
    NSURLErrorFileDoesNotExist =                 -1100,
    NSURLErrorFileIsDirectory =                  -1101,
    NSURLErrorNoPermissionsToReadFile =          -1102,
    NSURLErrorDataLengthExceedsMaximum 
                  NS_ENUM_AVAILABLE(10_5, 2_0) = -1103,

    // SSL errors
    NSURLErrorSecureConnectionFailed =           -1200,
    NSURLErrorServerCertificateHasBadDate =      -1201,
    NSURLErrorServerCertificateUntrusted =       -1202,
    NSURLErrorServerCertificateHasUnknownRoot =  -1203,
    NSURLErrorServerCertificateNotYetValid =     -1204,
    NSURLErrorClientCertificateRejected =        -1205,
    NSURLErrorClientCertificateRequired =        -1206,
    NSURLErrorCannotLoadFromNetwork =            -2000,

    // Download and file I/O errors
    NSURLErrorCannotCreateFile =                 -3000,
    NSURLErrorCannotOpenFile =                   -3001,
    NSURLErrorCannotCloseFile =                  -3002,
    NSURLErrorCannotWriteToFile =                -3003,
    NSURLErrorCannotRemoveFile =                 -3004,
    NSURLErrorCannotMoveFile =                   -3005,
    NSURLErrorDownloadDecodingFailedMidStream =  -3006,
    NSURLErrorDownloadDecodingFailedToComplete = -3007,

    NSURLErrorInternationalRoamingOff 
                  NS_ENUM_AVAILABLE(10_7, 3_0) = -1018,
    NSURLErrorCallIsActive 
                  NS_ENUM_AVAILABLE(10_7, 3_0) = -1019,
    NSURLErrorDataNotAllowed 
                  NS_ENUM_AVAILABLE(10_7, 3_0) = -1020,
    NSURLErrorRequestBodyStreamExhausted 
                  NS_ENUM_AVAILABLE(10_7, 3_0) = -1021,

    NSURLErrorBackgroundSessionRequiresSharedContainer 
                 NS_ENUM_AVAILABLE(10_10, 8_0) = -995,
    NSURLErrorBackgroundSessionInUseByAnotherProcess 
                 NS_ENUM_AVAILABLE(10_10, 8_0) = -996,
    NSURLErrorBackgroundSessionWasDisconnected 
                  NS_ENUM_AVAILABLE(10_10, 8_0)= -997,
};
最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
  • 序言:七十年代末,一起剥皮案震惊了整个滨河市,随后出现的几起案子,更是在滨河造成了极大的恐慌,老刑警刘岩,带你破解...
    沈念sama阅读 203,362评论 5 477
  • 序言:滨河连续发生了三起死亡事件,死亡现场离奇诡异,居然都是意外死亡,警方通过查阅死者的电脑和手机,发现死者居然都...
    沈念sama阅读 85,330评论 2 381
  • 文/潘晓璐 我一进店门,熙熙楼的掌柜王于贵愁眉苦脸地迎上来,“玉大人,你说我怎么就摊上这事。” “怎么了?”我有些...
    开封第一讲书人阅读 150,247评论 0 337
  • 文/不坏的土叔 我叫张陵,是天一观的道长。 经常有香客问我,道长,这世上最难降的妖魔是什么? 我笑而不...
    开封第一讲书人阅读 54,560评论 1 273
  • 正文 为了忘掉前任,我火速办了婚礼,结果婚礼上,老公的妹妹穿的比我还像新娘。我一直安慰自己,他们只是感情好,可当我...
    茶点故事阅读 63,580评论 5 365
  • 文/花漫 我一把揭开白布。 她就那样静静地躺着,像睡着了一般。 火红的嫁衣衬着肌肤如雪。 梳的纹丝不乱的头发上,一...
    开封第一讲书人阅读 48,569评论 1 281
  • 那天,我揣着相机与录音,去河边找鬼。 笑死,一个胖子当着我的面吹牛,可吹牛的内容都是我干的。 我是一名探鬼主播,决...
    沈念sama阅读 37,929评论 3 395
  • 文/苍兰香墨 我猛地睁开眼,长吁一口气:“原来是场噩梦啊……” “哼!你这毒妇竟也来了?” 一声冷哼从身侧响起,我...
    开封第一讲书人阅读 36,587评论 0 258
  • 序言:老挝万荣一对情侣失踪,失踪者是张志新(化名)和其女友刘颖,没想到半个月后,有当地人在树林里发现了一具尸体,经...
    沈念sama阅读 40,840评论 1 297
  • 正文 独居荒郊野岭守林人离奇死亡,尸身上长有42处带血的脓包…… 初始之章·张勋 以下内容为张勋视角 年9月15日...
    茶点故事阅读 35,596评论 2 321
  • 正文 我和宋清朗相恋三年,在试婚纱的时候发现自己被绿了。 大学时的朋友给我发了我未婚夫和他白月光在一起吃饭的照片。...
    茶点故事阅读 37,678评论 1 329
  • 序言:一个原本活蹦乱跳的男人离奇死亡,死状恐怖,灵堂内的尸体忽然破棺而出,到底是诈尸还是另有隐情,我是刑警宁泽,带...
    沈念sama阅读 33,366评论 4 318
  • 正文 年R本政府宣布,位于F岛的核电站,受9级特大地震影响,放射性物质发生泄漏。R本人自食恶果不足惜,却给世界环境...
    茶点故事阅读 38,945评论 3 307
  • 文/蒙蒙 一、第九天 我趴在偏房一处隐蔽的房顶上张望。 院中可真热闹,春花似锦、人声如沸。这庄子的主人今日做“春日...
    开封第一讲书人阅读 29,929评论 0 19
  • 文/苍兰香墨 我抬头看了看天上的太阳。三九已至,却和暖如春,着一层夹袄步出监牢的瞬间,已是汗流浃背。 一阵脚步声响...
    开封第一讲书人阅读 31,165评论 1 259
  • 我被黑心中介骗来泰国打工, 没想到刚下飞机就差点儿被人妖公主榨干…… 1. 我叫王不留,地道东北人。 一个月前我还...
    沈念sama阅读 43,271评论 2 349
  • 正文 我出身青楼,却偏偏与公主长得像,于是被迫代替她去往敌国和亲。 传闻我的和亲对象是个残疾皇子,可洞房花烛夜当晚...
    茶点故事阅读 42,403评论 2 342

推荐阅读更多精彩内容

  • 官网地址: http://developer.apple.com/library/mac/#documentati...
    哎呦我去叫什么呢阅读 486评论 0 0
  • 【1】7,9,-1,5,( ) A、4;B、2;C、-1;D、-3 分析:选D,7+9=16;9+(-1)=8;(...
    Alex_bingo阅读 18,795评论 1 19
  • csrf csrf攻击的意思:现在有网站a(正常),伪网站b(钓鱼),用户已经登录上网站a,假如此时用户不小心点击...
    yiludege阅读 349评论 0 0
  • 在2030年的纽约,一个以世界末日为主题的国际摄影展上。一组作品获得了极大的关注,先后在今年获得了普利策奖,荷赛奖...
    十颗药阅读 393评论 0 0
  • 我的眼圈开始红了 一遍遍听着你分享出来的歌 听着你的惆怅与寂寞 当初是我不够勇敢 总是质疑与不安 怎敢再去提遗憾 ...
    清九歌阅读 218评论 0 0