Is there any difference in the implementation of these three validation methods?

Posted by dontWatchMyProfile on Stack Overflow See other posts from Stack Overflow or by dontWatchMyProfile
Published on 2010-06-13T09:51:29Z Indexed on 2010/06/13 9:52 UTC
Read the original article Hit count: 120

Filed under:
|

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.

© Stack Overflow or respective owner

Related posts about iphone

Related posts about core-data