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 (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

Reply via email to