Problem with validate<Key>:error: or NSError ?
Problem with validate<Key>:error: or NSError ?
- Subject: Problem with validate<Key>:error: or NSError ?
- From: Gonzalo Castro <email@hidden>
- Date: Tue, 14 Aug 2007 21:02:50 -0400
Greetings,
Below is my property-level validation method. Why does the resulting
alert only show the description (and an OK button) but not the value
for NSLocalizedFailureReasonErrorKey? That is, why does the string
"the failure reason goes here" not appear?
- (BOOL) validateEmployee:(id *)value error:(NSError **)error
{
if ( [*value valueForKey: @"name"] == nil )
{
if ( error != nil )
{
NSDictionary *userInfo = [NSDictionary dictionaryWithObjectsAndKeys:
@"the description goes here", NSLocalizedDescriptionKey,
@"the failure reason goes here.",
NSLocalizedFailureReasonErrorKey,
nil];
NSError *myError = [[[NSError alloc] initWithDomain:
@"my.silly.domain"
code: 3
userInfo: userInfo] autorelease];
*error = myError;
}
return NO;
}
else
{
return YES;
}
}
Thanks,
Gonzalo
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden