• 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
Re: key value validation problem
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: key value validation problem


  • Subject: Re: key value validation problem
  • From: mmalcolm crawford <email@hidden>
  • Date: Tue, 3 Feb 2004 15:09:51 -0800

On Feb 3, 2004, at 1:07 PM, Ken Grigsby wrote:
I have a text field with a date formatter attached. If the user deletes
the text and tabs out I want to set the field to the current date so as
not to leave the field empty. My validation method is called when the
user tabs out and the model is updated but the UI is not updated. How
do I get the UI updated?
- (BOOL)validateDate:(id *)ioValue error:(NSError **)outError
{
if (*ioValue == nil)
{
// set date to today
*ioValue = [NSCalendarDate calendarDate];
}
return YES;
}

Offhand I don't *think* there's a trivial way to do this (although I'd love to be corrected). It would be useful if validation methods returned a ternary value, YES, NO, or ValueChanged. That would make trapping this situation easier, both for the inbuilt system, and for your own code. I've filed an enhancement request.

mmalc
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.

References: 
 >key value validation problem (From: Ken Grigsby <email@hidden>)

  • Prev by Date: Off Topic --- Problems With Modern lex/yacc and Old Code
  • Next by Date: Re: Cocoa/Windows parallel dvlpmt
  • Previous by thread: key value validation problem
  • Next by thread: Re: key value validation problem
  • Index(es):
    • Date
    • Thread