`
lizhuang
  • 浏览: 904119 次
  • 性别: Icon_minigender_1
  • 来自: 上海
社区版块
存档分类
最新评论

NSError错误userInfo key

 
阅读更多
User info dictionary keys
These keys may exist in the user info dictionary.

NSString * const NSLocalizedDescriptionKey;
NSString * const NSErrorFailingURLStringKey;
NSString * const NSFilePathErrorKey;
NSString * const NSStringEncodingErrorKey;
NSString * const NSUnderlyingErrorKey;
NSString * const NSURLErrorKey;
NSString * const NSLocalizedFailureReasonErrorKey;
NSString * const NSLocalizedRecoverySuggestionErrorKey;
NSString * const NSLocalizedRecoveryOptionsErrorKey;
NSString * const NSRecoveryAttempterErrorKey;
NSString * const NSHelpAnchorErrorKey;
NSString * const NSURLErrorFailingURLErrorKey;
NSString * const NSURLErrorFailingURLStringErrorKey;
NSString * const NSURLErrorFailingURLPeerTrustErrorKey;
Constants
NSLocalizedDescriptionKey
The corresponding value is a localized string representation of the error that, if present, will be returned by localizedDescription.
Available in iOS 2.0 and later.
Declared in NSError.h.
NSErrorFailingURLStringKey
The corresponding value is the URL that caused the error. This key is only present in the NSURLErrorDomain. (Deprecated. This constant is deprecated in OS X v10.6, and is superseded by NSURLErrorFailingURLStringErrorKey.)
This constant is deprecated in OS X v10.6, and is superseded by NSURLErrorFailingURLStringErrorKey. Both constants refer to the same value for backward-compatibility, but the new symbol name has a better prefix.
Available in iOS 2.0 and later.
Deprecated in iOS 4.0.
Declared in NSURLError.h.
NSFilePathErrorKey
Contains the file path of the error.
The corresponding value is an NSString object.
Available in iOS 2.0 and later.
Declared in NSError.h.
NSStringEncodingErrorKey
The corresponding value is an NSNumber object containing the NSStringEncoding value.
Available in iOS 2.0 and later.
Declared in NSError.h.
NSUnderlyingErrorKey
The corresponding value is an error that was encountered in an underlying implementation and caused the error that the receiver represents to occur.
Available in iOS 2.0 and later.
Declared in NSError.h.
NSURLErrorKey
The corresponding value is an NSURL object.
Available in iOS 2.0 and later.
Declared in NSError.h.
NSLocalizedFailureReasonErrorKey
The corresponding value is a localized string representation containing the reason for the failure that, if present, will be returned by localizedFailureReason.
This string provides a more detailed explanation of the error than the description.
Available in iOS 2.0 and later.
Declared in NSError.h.
NSLocalizedRecoverySuggestionErrorKey
The corresponding value is a string containing the localized recovery suggestion for the error.
This string is suitable for displaying as the secondary message in an alert panel.
Available in iOS 2.0 and later.
Declared in NSError.h.
NSLocalizedRecoveryOptionsErrorKey
The corresponding value is an array containing the localized titles of buttons appropriate for displaying in an alert panel.
The first string is the title of the right-most and default button, the second the one to the left, and so on. The recovery options should be appropriate for the recovery suggestion returned by localizedRecoverySuggestion.
Available in iOS 2.0 and later.
Declared in NSError.h.
NSRecoveryAttempterErrorKey
The corresponding value is an object that conforms to the NSErrorRecoveryAttempting informal protocol.
The recovery attempter must be an object that can correctly interpret an index into the array returned by recoveryAttempter.
Available in iOS 2.0 and later.
Declared in NSError.h.
NSHelpAnchorErrorKey
The corresponding value is an NSString containing the localized help corresponding to the help button. See helpAnchor for more information.
Available in iOS 4.0 and later.
Declared in NSError.h.
NSURLErrorFailingURLErrorKey
The corresponding value is an NSURL containing the URL which caused a load to fail. This key is only present in the NSURLErrorDomain.
Available in iOS 4.0 and later.
Declared in NSURLError.h.
NSURLErrorFailingURLStringErrorKey
The corresponding value is an NSString object for the URL which caused a load to fail. This key is only present in the NSURLErrorDomain.
This constant supersedes NSErrorFailingURLStringKey, which was deprecated in OS X v10.6. Both constants refer to the same value for backward-compatibility, but this symbol name has a better prefix.
Available in iOS 4.0 and later.
Declared in NSURLError.h.
NSURLErrorFailingURLPeerTrustErrorKey
The corresponding value is the SecTrustRef object representing the state of a failed SSL handshake. This key is only present in the NSURLErrorDomain.
Available in iOS 3.0 and later.
Declared in NSURLError.h.
分享到:
评论

相关推荐

    ios CoreData使用(封装)

    newManagedObject.setValue(value, forKey: key) } } do { try managedObjectContext.save() return newManagedObject } catch let error as NSError { print("Could not save. \(error), \(error.userInfo)...

    ios-极光推送实现页面跳转.zip

    - (void)application:(UIApplication *)application didFailToRegisterForRemoteNotificationsWithError:(NSError *)error { // 注册失败处理 } ``` 极光推送支持自定义payload,开发者可以在推送消息中添加额外的...

    CoreData数据验证

    如果验证失败,我们抛出一个错误,阻止数据的保存。 除了基本的验证,还可以通过监听`NSManagedObjectContextObjectsDidChange`通知来实现更复杂的数据一致性验证。例如,你可能希望在保存数据前检查实体之间的关系...

    IsOpenSDK集成与使用.mov

    IsOpenSDK通常会提供错误回调,例如`- (void)onSDKError:(NSError *)error`,你可以在这里处理SDK使用过程中出现的错误。同时,为了调试方便,可以开启SDK的日志输出,通过`[IsOpenSDK setLogLevel:...

    Core Data数据验证

    throw NSError(domain: "InvalidData", code: 1, userInfo: [NSLocalizedDescriptionKey: "Name is required"]) } if name.isEmpty { throw NSError(domain: "InvalidData", code: 2, userInfo: ...

    iOS 数组越界 Crash处理经验.docx

    *error = [NSError errorWithDomain:@"NSCocoaErrorDomain" code:-1 userInfo:[NSDictionary dictionaryWithObject:@"方法替换失败" forKey:NSLocalizedDescriptionKey]]; return NO; } } @end ``` 这段代码定义...

    IOS客户端远程推送

    - (void)application:(UIApplication *)application didReceiveRemoteNotification:(NSDictionary *)userInfo fetchCompletionHandler:(void (^)(UIBackgroundFetchResult))completionHandler { // 处理接收到的推...

    IOS CoreData使用

    fatalError("Unresolved error \(error), \(error.userInfo)") } } return container }() ``` ### 5. 使用Managed Object Context `ManagedObjectContext`是操作数据的核心。你可以通过`insertNewObject(for...

    ios 持久化存储

    fatalError("Unresolved error \(error), \(error.userInfo)") } } } var context: NSManagedObjectContext { return container.viewContext } } // 创建新的对象 let context = PersistenceController....

    Swift 3.0 使用Core Data demo代码

    `@objc`属性包装器使得属性能够被KVC(Key-Value Coding)访问,而`@NSManaged`则告诉编译器这些属性是由Core Data管理的。 总结一下,Swift 3.0在Core Data的使用上提供了更加简洁的语法,包括创建和管理实体、...

    MVVMWithoutRAC:http

    NSError *error = [NSError errorWithDomain:@"ParseError" code:0 userInfo:@{NSLocalizedDescriptionKey : @"Failed to parse JSON"}]; completion(nil, error); } } failure:^(NSURLSessionDataTask * _...

    iOS 把图片保存到相册,并获取图片文件名的实例

    completion(nil, NSError(domain: "", code: -1, userInfo: [NSLocalizedDescriptionKey: "无法获取图片"])) return } let fileURL = asset.value(forKey: "filename") as? String completion(fileURL, nil) ...

    iOS如何跳转到App Store下载评分页面示例代码

    NSLog(@"错误信息:%@", error.userInfo); } else { [self presentViewController:storeVC animated:YES completion:nil]; } }]; } ``` 4. 实现`SKStoreProductViewControllerDelegate`的方法`...

Global site tag (gtag.js) - Google Analytics