• 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: How to parse unpredictable date strings [WAS: Two digit dates with NSDateFormatter]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: How to parse unpredictable date strings [WAS: Two digit dates with NSDateFormatter]


  • Subject: Re: How to parse unpredictable date strings [WAS: Two digit dates with NSDateFormatter]
  • From: Matthew Lindfield Seager <email@hidden>
  • Date: Sun, 11 Oct 2009 20:42:11 +1100

Thanks for the help. The main gap in my understanding was that by default an
NSFormatter uses the same format string for converting a string to an object
and converting an object to a string. It is therefore fussy about how the
user types the string.

By subclassing the formatter you can customise the behaviour (i.e. have it
use a simple NSDateFormatterMediumStyle when formatting the date object to a
string but customise parsing behaviour when it converts a NSString to a date
object).

It now seems quite elementary so I apologise for the noise!

Matthew
_______________________________________________

Cocoa-dev mailing list (email@hidden)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

References: 
 >How to parse unpredictable date strings [WAS: Two digit dates with NSDateFormatter] (From: Matthew Lindfield Seager <email@hidden>)
 >Re: How to parse unpredictable date strings [WAS: Two digit dates with NSDateFormatter] (From: Nick Zitzmann <email@hidden>)

  • Prev by Date: Re: Newbie Core Data question.
  • Next by Date: Re: Newbie Core Data question.
  • Previous by thread: Re: How to parse unpredictable date strings [WAS: Two digit dates with NSDateFormatter]
  • Next by thread: Hardware UUID in New Mac Book Pro
  • Index(es):
    • Date
    • Thread