• 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
Intelligent NSFormatter
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


  • Follow-Ups:
    • Re: Intelligent NSFormatter
      • From: Keary Suska <email@hidden>
  • Prev by Date: Re: NSPopUpButton - addItemsWithTitles
  • Next by Date: Re: Hide a window on close?
  • Previous by thread: Re: determine if Dashboard is active...
  • Next by thread: Re: Intelligent NSFormatter
  • Index(es):
    • Date
    • Thread