Re: How to parse unpredictable date strings [WAS: Two digit dates with NSDateFormatter]
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