Reputation: 46360
Core Data is calling these methods in certain situations:
- (BOOL)validateForInsert:(NSError **)outError;
- (BOOL)validateForUpdate:(NSError **)outError;
- (BOOL)validateForDelete:(NSError **)outError;
I wonder if they're doing anything different, or if they're essentially doing the exact same things.
As far as I know, these methods call the -validateValue:forKey:error:
method once for every property.
The only difference I can imagine is in the .validateForDelete: method. I see no reason why to validate an object when it shall be deleted, except for applying delete rules, probably only in the case of the DENY rule.
Upvotes: 0
Views: 91
Reputation: 46718
These are lifecycle validation methods. There are many situations that the question of validation differs depending on the object's state. For example:
These methods give finer grain control over the integrity of the object hierarchy.
Upvotes: 1