Re: key value validation problem
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.