Reputation: 46360
I'd like to play around with attribute value validation, but the documentation is pretty empty on this. Maybe there's an good article or tutorial out there?
Upvotes: 0
Views: 110
Reputation: 64428
Here is a fairly common validation to ensure you don't get nonsensical dates put into a timeStamp.
- (BOOL)validateTimeStamp:(id *)valueRef error:(NSError **)outError
{
NSDate *testDate=(NSDate *) valueRef;
if ([testDate compare:self.minimumTimeStamp]==NSOrderedAscending) {
// generate and return error so you can set a proper date
}
return YES;
}
Upvotes: 1