- 浏览: 38863 次
- 性别:
- 来自: 北京
最新评论
NSError codes in the Cocoa error domain.
enum {
NSFileNoSuchFileError = 4,
NSFileLockingError = 255,
NSFileReadUnknownError = 256,
NSFileReadNoPermissionError = 257,
NSFileReadInvalidFileNameError = 258,
NSFileReadCorruptFileError = 259,
NSFileReadNoSuchFileError = 260,
NSFileReadInapplicableStringEncodingError = 261,
NSFileReadUnsupportedSchemeError = 262,
NSFileReadTooLargeError = 263,
NSFileReadUnknownStringEncodingError = 264,
NSFileWriteUnknownError = 512,
NSFileWriteNoPermissionError = 513,
NSFileWriteInvalidFileNameError = 514,
NSFileWriteInapplicableStringEncodingError = 517,
NSFileWriteUnsupportedSchemeError = 518,
NSFileWriteOutOfSpaceError = 640,
NSFileWriteVolumeReadOnlyError = 642m
NSKeyValueValidationError = 1024,
NSFormattingError = 2048,
NSUserCancelledError = 3072,
NSFileErrorMinimum = 0,
NSFileErrorMaximum = 1023,
NSValidationErrorMinimum = 1024,
NSValidationErrorMaximum = 2047,
NSFormattingErrorMinimum = 2048,
NSFormattingErrorMaximum = 2559,
NSPropertyListReadCorruptError = 3840,
NSPropertyListReadUnknownVersionError = 3841,
NSPropertyListReadStreamError = 3842,
NSPropertyListWriteStreamError = 3851,
NSPropertyListErrorMinimum = 3840,
NSPropertyListErrorMaximum = 4095
NSExecutableErrorMinimum = 3584,
NSExecutableNotLoadableError = 3584,
NSExecutableArchitectureMismatchError = 3585,
NSExecutableRuntimeMismatchError = 3586,
NSExecutableLoadError = 3587,
NSExecutableLinkError = 3588,
NSExecutableErrorMaximum = 3839,
}
URL Loading System Error Codes
These values are returned as the error code property of an NSError object with the domain “NSURLErrorDomain”.
typedef enum
{
NSURLErrorUnknown = -1,
NSURLErrorCancelled = -999,
NSURLErrorBadURL = -1000,
NSURLErrorTimedOut = -1001,
NSURLErrorUnsupportedURL = -1002,
NSURLErrorCannotFindHost = -1003,
NSURLErrorCannotConnectToHost = -1004,
NSURLErrorDataLengthExceedsMaximum = -1103,
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,
NSURLErrorFileDoesNotExist = -1100,
NSURLErrorFileIsDirectory = -1101,
NSURLErrorNoPermissionsToReadFile = -1102,
NSURLErrorSecureConnectionFailed = -1200,
NSURLErrorServerCertificateHasBadDate = -1201,
NSURLErrorServerCertificateUntrusted = -1202,
NSURLErrorServerCertificateHasUnknownRoot = -1203,
NSURLErrorServerCertificateNotYetValid = -1204,
NSURLErrorClientCertificateRejected = -1205,
NSURLErrorClientCertificateRequired = -1206,
NSURLErrorCannotLoadFromNetwork = -2000,
NSURLErrorCannotCreateFile = -3000,
NSURLErrorCannotOpenFile = -3001,
NSURLErrorCannotCloseFile = -3002,
NSURLErrorCannotWriteToFile = -3003,
NSURLErrorCannotRemoveFile = -3004,
NSURLErrorCannotMoveFile = -3005,
NSURLErrorDownloadDecodingFailedMidStream = -3006,
NSURLErrorDownloadDecodingFailedToComplete = -3007
}
转自 http://hi.baidu.com/yanh105/blog/item/b98e911a9e98ba61dbb4bd1a.html
enum {
NSFileNoSuchFileError = 4,
NSFileLockingError = 255,
NSFileReadUnknownError = 256,
NSFileReadNoPermissionError = 257,
NSFileReadInvalidFileNameError = 258,
NSFileReadCorruptFileError = 259,
NSFileReadNoSuchFileError = 260,
NSFileReadInapplicableStringEncodingError = 261,
NSFileReadUnsupportedSchemeError = 262,
NSFileReadTooLargeError = 263,
NSFileReadUnknownStringEncodingError = 264,
NSFileWriteUnknownError = 512,
NSFileWriteNoPermissionError = 513,
NSFileWriteInvalidFileNameError = 514,
NSFileWriteInapplicableStringEncodingError = 517,
NSFileWriteUnsupportedSchemeError = 518,
NSFileWriteOutOfSpaceError = 640,
NSFileWriteVolumeReadOnlyError = 642m
NSKeyValueValidationError = 1024,
NSFormattingError = 2048,
NSUserCancelledError = 3072,
NSFileErrorMinimum = 0,
NSFileErrorMaximum = 1023,
NSValidationErrorMinimum = 1024,
NSValidationErrorMaximum = 2047,
NSFormattingErrorMinimum = 2048,
NSFormattingErrorMaximum = 2559,
NSPropertyListReadCorruptError = 3840,
NSPropertyListReadUnknownVersionError = 3841,
NSPropertyListReadStreamError = 3842,
NSPropertyListWriteStreamError = 3851,
NSPropertyListErrorMinimum = 3840,
NSPropertyListErrorMaximum = 4095
NSExecutableErrorMinimum = 3584,
NSExecutableNotLoadableError = 3584,
NSExecutableArchitectureMismatchError = 3585,
NSExecutableRuntimeMismatchError = 3586,
NSExecutableLoadError = 3587,
NSExecutableLinkError = 3588,
NSExecutableErrorMaximum = 3839,
}
URL Loading System Error Codes
These values are returned as the error code property of an NSError object with the domain “NSURLErrorDomain”.
typedef enum
{
NSURLErrorUnknown = -1,
NSURLErrorCancelled = -999,
NSURLErrorBadURL = -1000,
NSURLErrorTimedOut = -1001,
NSURLErrorUnsupportedURL = -1002,
NSURLErrorCannotFindHost = -1003,
NSURLErrorCannotConnectToHost = -1004,
NSURLErrorDataLengthExceedsMaximum = -1103,
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,
NSURLErrorFileDoesNotExist = -1100,
NSURLErrorFileIsDirectory = -1101,
NSURLErrorNoPermissionsToReadFile = -1102,
NSURLErrorSecureConnectionFailed = -1200,
NSURLErrorServerCertificateHasBadDate = -1201,
NSURLErrorServerCertificateUntrusted = -1202,
NSURLErrorServerCertificateHasUnknownRoot = -1203,
NSURLErrorServerCertificateNotYetValid = -1204,
NSURLErrorClientCertificateRejected = -1205,
NSURLErrorClientCertificateRequired = -1206,
NSURLErrorCannotLoadFromNetwork = -2000,
NSURLErrorCannotCreateFile = -3000,
NSURLErrorCannotOpenFile = -3001,
NSURLErrorCannotCloseFile = -3002,
NSURLErrorCannotWriteToFile = -3003,
NSURLErrorCannotRemoveFile = -3004,
NSURLErrorCannotMoveFile = -3005,
NSURLErrorDownloadDecodingFailedMidStream = -3006,
NSURLErrorDownloadDecodingFailedToComplete = -3007
}
转自 http://hi.baidu.com/yanh105/blog/item/b98e911a9e98ba61dbb4bd1a.html
发表评论
-
IOS
2012-06-08 18:08 2185转自 http://site.douban.com/ ... -
iPhone4文件结构分析列表
2012-06-06 18:25 11、 【/Applications】 ... -
IOS 入门开发之使用Xcode4制作静态库详解
2012-05-23 16:40 1204雨松MOMO原创文章如转载,请注明:转载自雨松MOMO的博客原 ... -
iOS4中Core Motion框架的介绍和使用
2012-04-18 20:47 930http://www.kunli.info/2010/07/3 ... -
iOS5新开发的API总述——WWDC 2011
2012-03-23 13:03 1831转自 http://alloc.sinaapp.com ... -
中文版多线程编程指南
2012-03-19 19:33 965转自http://www.cocoachina.com/iph ... -
iPhone 路径大全
2012-03-13 11:41 9751、【/Applications】 常用 ... -
App Store审核指南
2012-03-08 19:19 965前言 感谢您付出宝 ... -
iOS设备型号与产品名称的对应
2012-03-07 21:47 2363"iPhone1,1" => &qu ... -
gzip文件的解压缩
2012-03-07 10:21 1427to allow zlib compression/decom ... -
iOS平台开发者总结出的宝贵上架经验
2012-03-06 16:06 1107以下是许多iOS平台开发者总结出的宝贵上架经验: 基本 ... -
版本控制清除所有.svn目录
2012-02-29 18:04 1574删除这些目录是很简单的,命令如下find . -type d ... -
UIView的一些基本方法理解:loadView、viewDidLoad、viewDidUnload、viewWillAppear、viewWillDisapp
2012-02-29 15:51 1819对于其它几个基本方法就不那么常用了,为了更好地编程使用这些方法 ... -
iphone音乐播放
2012-02-28 14:20 1292在 iPhone 应用或者是游戏的开发过程中,对声音的支持是必 ... -
Zlib的deflate, z_stream结构的使用
2012-02-20 22:52 3687Zlib的deflate, z_stream结构的 ... -
iphone通讯录AddressBook.framework和AddressBookUI.framework的应用
2012-02-02 12:26 3196通讯录中联系人相关的应用iPhone提供了两个框架:Ad ...
相关推荐
- 在失败的回调块中,`error`对象包含了错误信息,可以用来分析并处理错误。 8. **网络状态监控**: - 使用`AFNetworkReachabilityManager`来监听网络可达性变化,以便在无网络时做出相应处理。 通过上述步骤,...
1. **GET请求**:通过`[manager GET:@"url" parameters:nil success:^(AFHTTPRequestOperation *operation, id responseObject) {...} failure:^(AFHTTPRequestOperation *operation, NSError *error) {...}]`发起...
本篇文章将深入探讨...在实际开发中,可能还需要处理网络错误、缓存策略、取消请求等问题。通过理解这些基本操作,开发者可以更高效地在iOS应用中实现网络功能。记得在实际应用中根据项目需求进行适当的修改和扩展。
// 用户验证失败或取消,显示错误信息或提供其他验证方式 } } ``` 需要注意的是,当用户未设置生物识别或设备不支持时,`canEvaluatePolicy`会返回`false`。此时,你可以提示用户设置TouchID或FaceID,或者切换到...
最后,文档总结了错误处理中的一些关键点,如错误域和错误代码的定义、NSError对象的创建和使用、本地化错误信息的方法、错误传播和显示的技术,以及在应用程序中实现错误响应者链和错误恢复的策略。这些内容对于...
它包含了错误代码、域和用户信息等,但默认情况下,错误信息可能不够详细,对于开发者来说,理解错误的具体原因可能会有些困难。`getErrorCodeDescription`方法的引入就是为了解决这个问题。 当网络请求失败时,...
在请求失败的回调中,`NSError`对象包含了错误信息,可以根据错误码和用户信息进行相应处理。 ### 使用Block简化请求 AFN也提供了基于Block的简写方式,使代码更简洁: ```objc AFHTTPRequestOperationManager *...
switch error.code { case LAError.userCancel: print("用户取消") case LAError.userFallback: print("用户选择输入密码") case LAError.biometryNotAvailable: print("生物识别不可用") case LAError....
NSURL *fileURL = [[ NSBundle mainBundle ] URLForResource: @" sample " withExtension: @" xml " ];NSData *feedData = [ NSData dataWithContentsOfURL: fileURL];id <DLTFeed> feed = [DLTFeed feedWithData: ...
var error: NSError? if context.canEvaluatePolicy(.deviceOwnerAuthenticationWithBiometrics, error: &error) { // TouchID可用,可以进行身份验证 } else { // TouchID不可用或配置错误 } ``` 4. **执行...
error.code有多种可能的值,例如13表示已连接,7表示用户取消连接等。在错误处理中,需要根据不同的错误码进行相应的处理。 5. Simulator的注意事项 由于NEHotspotConfigurationManager类在模拟器上不可用,因此...
7. 错误处理:在`requestFailed:`方法中,可以获取到`NSError`对象,通过`error.localizedDescription`获取错误信息。 8. 取消请求:如果需要取消正在进行的请求,可以调用`[request cancel]`。 虽然...
此外,错误对象( NSError 对象在Objective-C中,Error类型在Swift中)可以用来封装详细的信息,包括错误代码、本地化的错误描述等,这些信息在构建错误提示界面时非常有用。 对于源码的结构,我们可以期待以下组件...
示例(使用Google搜索):let url = NSURL(string:"https://www.google.com")! let value = "Erik The Phantom of Opera" // visit var future: Future, NSError> = Erik.visitURLFuture(url) // ...
如果用户成功扫描指纹,`evaluatePolicy`的完成闭包将返回`success`为`true`,反之则会返回错误信息。 此外,`TouchID_Demo`可能还包括了错误处理的示例,例如处理设备无TouchID、TouchID被禁用或者用户连续多次...
- 解析过程中,如果XML格式错误,GDataXML会通过NSError对象返回错误信息。 2. **查询XML结构**: - `GDataXMLNode`类提供了丰富的查询方法,如`elementsForName:`、`attributeForLocalName:`和`...
作为`AVAudioPlayer`的代理,我们需要实现`audioPlayerDidFinishPlaying:`方法,以便在播放结束时执行相应操作,如重新播放或显示提示信息: ```objc // 在ViewController中声明代理协议 @interface ViewController...
当身份验证失败时,错误对象可能包含关于失败原因的更多信息。例如,用户可能没有设置生物识别,或者他们连续多次验证失败。你可以检查`LAError`枚举的值来了解具体问题。 7. **考虑兼容性和用户体验** 为了提供...
通过错误对象(`error`),我们可以获取到具体错误信息并做出相应的处理。 七、权限提示与用户隐私 在iOS中,使用生物识别功能需要遵循App Store审核指南,确保尊重用户隐私。在请求验证前,应提供足够的上下文,让...
4. **隐私保护**:当收到通知时,设备会通过Face ID识别用户是否是手机持有者,以决定是否显示详细信息。 5. **iTunes及App Store购买**:下载付费应用或进行应用内购买时,Face ID可简化验证过程。 **安全性考虑**...