Strange NSNumberFormatter behavior
Strange NSNumberFormatter behavior
- Subject: Strange NSNumberFormatter behavior
- From: Karolis Ramanauskas <email@hidden>
- Date: Tue, 10 Nov 2009 21:18:25 -0600
Good evening,
My question involves the code below:
NSNumberFormatter * nf = [[[NSNumberFormatter alloc] init] autorelease];
[nf setNumberStyle:NSNumberFormatterSpellOutStyle];
NSLog(@"'%@'", [nf numberFromString:@"one"]); // <- LINE A
NSLog(@"'%@'", [nf numberFromString:@"one two"]); // <- LINE B
On OSX10.6, line A will generate '1', however line B will generate 'nil'.
This is the behavior on which my method relies. However, the same code on
iPhone (or at least iPhone Simulator 3.1) generates '1' in both cases, this
causes my method to behave differently on these platforms. I was trying
different NSNumberFormatter properties to achieve the same behavior with no
avail.
I've also tried getObjectValue:forString:range:error method and it has the
same behavior.
Any help is appreciated.
Thanks
_______________________________________________
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