Re: [Q] NSDecimalSeparator
Re: [Q] NSDecimalSeparator
- Subject: Re: [Q] NSDecimalSeparator
- From: Kurt Revis <email@hidden>
- Date: Sat, 10 Nov 2001 19:25:01 -0800
I have a very puzzling and surreal encounter with NSDecimalSeparator. I
want to find out what the decimal charater is, so I have the following
code:
NSString *str = NSDecimalSeparator;
... // more code that examines and uses the first unichar of the string
then in gdb, I put a break point after that line. When it runs to the
breakpoint, I type in the command: po str. Guess what I get?
(gdb) po [str class]
NSConstantString
(gdb) po str
NSDecimalSeparator
NSDecimalSeparator is not the separator itself. It is an identifier for
the value in the user's defaults. See the documentation for
NSUserDefaults.
Specifically, what you want is
NSString *str = [[NSUserDefaults standardUserDefaults]
stringForKey:NSDecimalSeparator];
You get the output you saw because the the constant named
NSDecimalSeparator is really a string with the value
@"NSDecimalSeparator". Make sense?
--
Kurt Revis
email@hidden