Customizing the alert shown by validate<Key>
Customizing the alert shown by validate<Key>
- Subject: Customizing the alert shown by validate<Key>
- From: Kaspar Fischer <email@hidden>
- Date: Tue, 11 Jan 2005 14:33:44 +0100
Hi All,
I have a text field whose value is bound to some controlled
string with key "text". In the model, I have the following
routine which validates the contents of the text field:
- (BOOL)validateText:(id *)ioValue error:(NSError **)outError
{
if ([self currentCategory:*ioValue] >= 0)
return YES;
*outError = [NSError errorWithDomain:
@"The text you entered is not a valid setting."
code:0 userInfo:nil];
return NO;
}
This works quite well expect that the alert which is shown
is very ugly: It says
ALERT
Error The text you entered is not a valid list setting. 0
<Discard Changes> <OK>
I would prefer a nice, customized title (instead of ALERT)
and no "Error". Can one customize the alert? Maybe by filling
the above userInfo dictionary appropriately?
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