• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag
 

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: [Q] NSDecimalSeparator
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


  • Follow-Ups:
    • Re: [Q] NSDecimalSeparator
      • From: Joe Chan <email@hidden>
References: 
 >[Q] NSDecimalSeparator (From: Joe Chan <email@hidden>)

  • Prev by Date: [Q] NSDecimalSeparator
  • Next by Date: Putting files in Trash
  • Previous by thread: [Q] NSDecimalSeparator
  • Next by thread: Re: [Q] NSDecimalSeparator
  • Index(es):
    • Date
    • Thread