Core Data: Validation, Relationships, and Fetched Properties
1. Core Data Validation Error Handling
When running an app and adding a new hero, if you enter edit mode, clear the Name field, and then tap the Identity field, a validation alert dialog will appear. However, it may not display the proper failure reason.
The validate method in the relevant code populates the message like this:
message = NSLocalizedString("Validation error on \(errorKey)\rFailure Reason: \(reason)",
comment: "Validation error on \(errorKey)\rFailure Reason: \(reason)")
But the call to error?.localizedFailureReason returns nil because, prior to iOS 4, Core
超级会员免费看
订阅专栏 解锁全文

被折叠的 条评论
为什么被折叠?



