• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Customizing the alert shown by validate<Key>
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


  • Prev by Date: Re: Defining Accessors in a Custom Palette for a NSArray for Cocoa Bindings
  • Next by Date: Re: MySQL Escaped String
  • Previous by thread: Re: Zip-files
  • Next by thread: programmatically binding
  • Index(es):
    • Date
    • Thread