Re: Scanfloat & Locale
Re: Scanfloat & Locale
- Subject: Re: Scanfloat & Locale
- From: Chris Kane <email@hidden>
- Date: Wed, 3 Aug 2005 09:31:08 -0700
You are using the wrong key string constants in scannerLocale. Use
the ones in NSUserDefaults.h instead for setting up a locale dictionary.
Confusing I know. And probably almost impossible for us to ever fix
due to the existence of subclasses out there.
Chris Kane
Cocoa Framework, Apple
On Jul 30, 2005, at 7:56 AM, Marco Michieli wrote:
I'm trying to scan a list of floats from an http page.
The float numbers use:
- "." as 1000 separator
- "," as decimal separator
I've set the locale for the Scanner to correctly recognize the
separators, but it does not work.
The Scanner seems to completely ignore the locale settings.
Here below a simplified version of my code and the correspondent
Run Log
What's wrong with my code?
Thanks
Marco
[scannerLocale setObject:@"." forKey:NSLocaleGroupingSeparator];
[scannerLocale setObject:@"," forKey:NSLocaleDecimalSeparator];
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden