• 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: NSScanner troubles
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: NSScanner troubles


  • Subject: Re: NSScanner troubles
  • From: Ken Thomases <email@hidden>
  • Date: Fri, 10 Dec 2010 22:54:43 -0600

On Dec 10, 2010, at 9:38 PM, WT wrote:

> thank you both for the very fast response.

You're welcome.

> Is that behavior of NSScanner documented anywhere? I read the docs but don't remember coming across it. I'm a bit stunned. What's the point of having a scanner if it ignores certain key aspects of the locale?

It's not ignoring the locale.  There are just different ways of formatting numbers, and NSScanner just wasn't designed to understand some of them.  Group separators are more relevant to human-readable numbers than computer-readable ones.

I would venture to say that NSScanner is an object-oriented analog to the scanf family of functions from the standard C library.  Those do not understand group separators, either.  It's pretty much the norm for number-scanning library routines.  It's also the norm for library routines to not include group separators when formatting numbers for output.  (e.g. -[NSNumber stringValue])

Regards,
Ken

_______________________________________________

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

  • Follow-Ups:
    • Re: NSScanner troubles
      • From: Ron Fleckner <email@hidden>
References: 
 >NSScanner troubles (From: WT <email@hidden>)
 >Re: NSScanner troubles (From: Greg Parker <email@hidden>)
 >Re: NSScanner troubles (From: WT <email@hidden>)

  • Prev by Date: Re: NSUnarchiver / Data.archive Extract all Keys
  • Next by Date: Re: NSScanner troubles
  • Previous by thread: Re: NSScanner troubles
  • Next by thread: Re: NSScanner troubles
  • Index(es):
    • Date
    • Thread