...
- (BOOL)validateForInsert:(NSError **)outError
- (BOOL) validateForUpdate:(NSError **)outError
@end
The method validateNameOrSecretIdentity: does our cross-field validation by looking at the two fields, but it doesn't do the rest of the validations, such as those from the data model, or those from custom validation methods. To handle those, we need a call to super.
The easiest way to handle this is to simply call super if validateNameOrSecretIdentity: returns NO. Typically, once we hit an error, we don't keep going. We could implement a more complex version that kept a running track of all errors and returned them, but I'm going to keep things simple here. Replace the code above with the following to get the rest of the validations working again:
...
- (BOOL)validateForInsert:(NSError **)outError
- (BOOL)validateForUpdate:(NSError **)outError
@end
I apologize for that!
No comments:
Post a Comment