GuybrushThreepwood
GuybrushThreepwood

Reputation: 5616

Core Data Validation Method Not Being Called - iPhone

I have a NSManagedObject subclass and I am trying to get data validation to work using the following method in this subclass :

- (BOOL)validatefirstName:(NSString *)ioValue error : (NSError **)outError {
NSLog(@"Validating First Name");
return YES;
}

The problem is that this method is not triggering when a new value is saved to this class. Should this method be called automatically when I change the value of an attribute within it, or do I need to call another method first ?

Thanks.

Upvotes: 1

Views: 168

Answers (1)

Mark Kryzhanouski
Mark Kryzhanouski

Reputation: 7241

Your validation method signature is not valid. Should be as:

- (BOOL)validateFirstName:(NSString *)ioValue error : (NSError **)outError

For more info refer to Validation Method Naming Convention.

Upvotes: 2

Related Questions