On Dec 11, 2010, at 9:42 PM, Stephen J. Butler wrote: > On Sat, Dec 11, 2010 at 5:37 PM, WT <jrca...@gmail.com> wrote: >> thanks for replying. I tried it and it gives the exact same results as >> before, that is, the presence of the group separator causes the number >> formatter to return nil. Besides, there remains the date formatter issue. > > Forgive me for using FScript, but I find it easier to prototype these > kinds of Cocoa problems: > >> l := NSLocale alloc initWithLocaleIdentifier:'pt_BR' > >> nf := NSNumberFormatter alloc init > >> nf setLocale:l > >> nf setUsesGroupingSeparator:YES > >> nf numberFromString:'1.111,20' > 1111.2 > >> df := NSDateFormatter alloc init > >> df setLocale:l > >> df setDateStyle:NSDateFormatterShortStyle > >> df dateFromString:'23/04/2010' > 2010-04-23 00:00:00 -0500 > > > Works for me!
I'll have to look up about FScript since I didn't know about it. Anyway, using setDateStyle:NSDateFormatterShortStyle works, though it still doesn't make sense to me that I should set a particular style for reading in data when I can't be sure what format the data is going to be provided to me now or in the future. However, setUsesGroupingSeparator:YES still has no effect for me. May I send you (off-list) the test project? Thanks again. WT_______________________________________________ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) 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: http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com