NSValidationNumberTooSmallError with incomplete error message
NSValidationNumberTooSmallError with incomplete error message
- Subject: NSValidationNumberTooSmallError with incomplete error message
- From: Kaspar Fischer <email@hidden>
- Date: Tue, 6 Sep 2005 10:54:59 +0200
Hi all,
I use CoreData and the NSKeyValueCoding protocol to
implement validation. My entity has an attribute
value and therefore I have a routine
- (BOOL)validateValue:(id *)value error:(NSError **)error
{
// ...
NSDictionary *userInfo = [NSDictionary dictionaryWithObjectsAndKeys:
@"value", NSValidationKeyErrorKey,
*value, NSValidationValueErrorKey,
self, NSValidationObjectErrorKey, nil];
*error = [[NSError errorWithDomain:NSCocoaErrorDomain
code:NSValidationNumberTooSmallError
userInfo:userInfo] retain];
return NO;
}
The mechanism works fine, but the error sheet that
gets displayed only says
The document "Untitled" could not be saved.
%{PROPERTY}@ is too small.
It seems that I am not passing enough information in
the user dictionary to make CoreData replace the ugly
"%PROPERTY@" by "value". Does anyboy know how to
solve this?
Thanks,
Kaspar
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden