Intelligent NSFormatter
Intelligent NSFormatter
- Subject: Intelligent NSFormatter
- From: Mike Abdullah <email@hidden>
- Date: Thu, 14 Sep 2006 20:14:22 +0100
I am wanting to implement in my app an NSTextField for displaying and
editing dates using Cocoa Bindings. Normally I would make use of an
NSValueTransformer or NSFormatter, but that doesn't work quite like I
want.
Here's the requirements:
* The text field should display the date as text using the user's
NSShortDateFormatString preference
* As the user types, if a valid date is entered, the field should
change its text to the default way of displaying the date (I'm not
entirely sure about this one yet!)
* If the user ends editing of the text field without entering a valid
date, the text field should revert to the last valid date they entered.
So, is this possible with NSFormatter and NSValueTransformer (and
that therefore I've missed something), or do I need a different
method. If so, what would people recommend?
Mike.
_______________________________________________
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