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,
};
最后編輯于
?著作權(quán)歸作者所有,轉(zhuǎn)載或內(nèi)容合作請聯(lián)系作者
  • 序言:七十年代末辐脖,一起剝皮案震驚了整個濱河市限寞,隨后出現(xiàn)的幾起案子雕崩,更是在濱河造成了極大的恐慌厦酬,老刑警劉巖,帶你破解...
    沈念sama閱讀 222,000評論 6 515
  • 序言:濱河連續(xù)發(fā)生了三起死亡事件炬灭,死亡現(xiàn)場離奇詭異醋粟,居然都是意外死亡,警方通過查閱死者的電腦和手機重归,發(fā)現(xiàn)死者居然都...
    沈念sama閱讀 94,745評論 3 399
  • 文/潘曉璐 我一進店門米愿,熙熙樓的掌柜王于貴愁眉苦臉地迎上來,“玉大人鼻吮,你說我怎么就攤上這事育苟。” “怎么了椎木?”我有些...
    開封第一講書人閱讀 168,561評論 0 360
  • 文/不壞的土叔 我叫張陵违柏,是天一觀的道長。 經(jīng)常有香客問我拓哺,道長勇垛,這世上最難降的妖魔是什么? 我笑而不...
    開封第一講書人閱讀 59,782評論 1 298
  • 正文 為了忘掉前任士鸥,我火速辦了婚禮,結(jié)果婚禮上谆级,老公的妹妹穿的比我還像新娘烤礁。我一直安慰自己,他們只是感情好肥照,可當我...
    茶點故事閱讀 68,798評論 6 397
  • 文/花漫 我一把揭開白布脚仔。 她就那樣靜靜地躺著,像睡著了一般舆绎。 火紅的嫁衣襯著肌膚如雪鲤脏。 梳的紋絲不亂的頭發(fā)上,一...
    開封第一講書人閱讀 52,394評論 1 310
  • 那天,我揣著相機與錄音猎醇,去河邊找鬼窥突。 笑死,一個胖子當著我的面吹牛硫嘶,可吹牛的內(nèi)容都是我干的阻问。 我是一名探鬼主播,決...
    沈念sama閱讀 40,952評論 3 421
  • 文/蒼蘭香墨 我猛地睜開眼沦疾,長吁一口氣:“原來是場噩夢啊……” “哼称近!你這毒婦竟也來了?” 一聲冷哼從身側(cè)響起哮塞,我...
    開封第一講書人閱讀 39,852評論 0 276
  • 序言:老撾萬榮一對情侶失蹤刨秆,失蹤者是張志新(化名)和其女友劉穎,沒想到半個月后忆畅,有當?shù)厝嗽跇淞掷锇l(fā)現(xiàn)了一具尸體衡未,經(jīng)...
    沈念sama閱讀 46,409評論 1 318
  • 正文 獨居荒郊野嶺守林人離奇死亡,尸身上長有42處帶血的膿包…… 初始之章·張勛 以下內(nèi)容為張勛視角 年9月15日...
    茶點故事閱讀 38,483評論 3 341
  • 正文 我和宋清朗相戀三年邻眷,在試婚紗的時候發(fā)現(xiàn)自己被綠了眠屎。 大學時的朋友給我發(fā)了我未婚夫和他白月光在一起吃飯的照片。...
    茶點故事閱讀 40,615評論 1 352
  • 序言:一個原本活蹦亂跳的男人離奇死亡肆饶,死狀恐怖改衩,靈堂內(nèi)的尸體忽然破棺而出,到底是詐尸還是另有隱情驯镊,我是刑警寧澤葫督,帶...
    沈念sama閱讀 36,303評論 5 350
  • 正文 年R本政府宣布,位于F島的核電站板惑,受9級特大地震影響橄镜,放射性物質(zhì)發(fā)生泄漏。R本人自食惡果不足惜冯乘,卻給世界環(huán)境...
    茶點故事閱讀 41,979評論 3 334
  • 文/蒙蒙 一洽胶、第九天 我趴在偏房一處隱蔽的房頂上張望。 院中可真熱鬧裆馒,春花似錦姊氓、人聲如沸。這莊子的主人今日做“春日...
    開封第一講書人閱讀 32,470評論 0 24
  • 文/蒼蘭香墨 我抬頭看了看天上的太陽。三九已至梗搅,卻和暖如春禾唁,著一層夾襖步出監(jiān)牢的瞬間效览,已是汗流浹背。 一陣腳步聲響...
    開封第一講書人閱讀 33,571評論 1 272
  • 我被黑心中介騙來泰國打工荡短, 沒想到剛下飛機就差點兒被人妖公主榨干…… 1. 我叫王不留丐枉,地道東北人。 一個月前我還...
    沈念sama閱讀 49,041評論 3 377
  • 正文 我出身青樓肢预,卻偏偏與公主長得像矛洞,于是被迫代替她去往敵國和親。 傳聞我的和親對象是個殘疾皇子烫映,可洞房花燭夜當晚...
    茶點故事閱讀 45,630評論 2 359

推薦閱讀更多精彩內(nèi)容

  • 官網(wǎng)地址: http://developer.apple.com/library/mac/#documentati...
    哎呦我去叫什么呢閱讀 491評論 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,961評論 1 19
  • csrf csrf攻擊的意思:現(xiàn)在有網(wǎng)站a(正常)孕荠,偽網(wǎng)站b(釣魚)娩鹉,用戶已經(jīng)登錄上網(wǎng)站a,假如此時用戶不小心點擊...
    yiludege閱讀 363評論 0 0
  • 在2030年的紐約稚伍,一個以世界末日為主題的國際攝影展上弯予。一組作品獲得了極大的關(guān)注,先后在今年獲得了普利策獎个曙,荷賽獎...
    十顆藥閱讀 401評論 0 0
  • 我的眼圈開始紅了 一遍遍聽著你分享出來的歌 聽著你的惆悵與寂寞 當初是我不夠勇敢 總是質(zhì)疑與不安 怎敢再去提遺憾 ...
    清九歌閱讀 225評論 0 0