I have an ArrayController bound to a master/detail UI which is working just great. I’m now trying to implement validation at the model level.
Apple docs indicate the follow should work to validate individual properties:
-(BOOL)validateName:(id *)ioValue error:(NSError * __autoreleasing *)outError
So if I have a model property of “ProjectName”, the following should automatically fire:
-(BOOL)validateProjectName:(id *)ioValue error:(NSError * __autoreleasing *)outError
But unfortunately, it just doesn’t happen 🙁
However, interestingly, if I use the “catch all” method as below, it DOES work:
-(BOOL)validateValue:(inout __autoreleasing id *)ioValue forKey:(NSString *)inKey error:(out NSError *__autoreleasing *)outError {
Within the method I can code to determine which property is being validated of course, but I can’t figure out why it completely ignores the accessor method?
Can anyone shed any light on this?
The validation method does not automatically fire – from your linked documentation:
And also:
Which explains your second situation.