• 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: Putting Non Date in Date formatted text field
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Putting Non Date in Date formatted text field


  • Subject: Re: Putting Non Date in Date formatted text field
  • From: Ondra Cada <email@hidden>
  • Date: Tue, 26 Feb 2002 16:27:42 +0100

John,

>>>>>> John Pattenden (JP) wrote at Mon, 25 Feb 2002 19:48:49 -0800:
JP> I have a date field that is an expiration date. When I expire I want
JP> to change from displaying a date to displaying "Expired" - i tried
JP>
JP> [IBexpirationDate setObjectValue:@"Expired"];
JP>
JP> which didn't work.... ( i get a blank).. can I tell the formatter to
JP> ignore this? or something else???

Well, a date formatter formats dates ;)

The best way IMHO is to remove the date formatter if a non-date is to be
shown. Somewhat cleaner *perhaps* might be not to use formatter over the
field at all, but use it internally to preformat values to be shown there if
needed.

Third, you can make your own date formatter, which would interpret some
illegal date (or perhaps nil or so) as "expired" and show it that way. It
seems to be the cleanest way, but looks like a bit of overkill for that task.
---
Ondra Cada
OCSoftware: email@hidden http://www.ocs.cz
2K Development: email@hidden http://www.2kdevelopment.cz
private email@hidden http://www.ocs.cz/oc
_______________________________________________
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: 
 >Nevermind.. (From: John Pattenden <email@hidden>)

  • Prev by Date: NSImageCell continued...
  • Next by Date: dd: IP address via Terminal
  • Previous by thread: Nevermind..
  • Next by thread: Another filesystem mystery
  • Index(es):
    • Date
    • Thread