• 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: Looking for [NSNumber numberWithString:]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Looking for [NSNumber numberWithString:]


  • Subject: Re: Looking for [NSNumber numberWithString:]
  • From: Kyle Sluder <email@hidden>
  • Date: Thu, 2 Apr 2009 08:16:14 -0400

On Wed, Apr 1, 2009 at 9:17 PM, Greg Robertson <email@hidden> wrote:
> I would like to convert an NSString to an NSNumber. Is there a direct
> method for this or should I go NSString to double and then double to
> NSNumber?

Use an NSNumberFormatter.  Then your results will actually be valid
for the correct locale -- otherwise, what happens when someone gives
you "123,4"?

--Kyle Sluder
_______________________________________________

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: Looking for [NSNumber numberWithString:]
      • From: Greg Robertson <email@hidden>
References: 
 >Looking for [NSNumber numberWithString:] (From: Greg Robertson <email@hidden>)

  • Prev by Date: Re: NSPopUpButton pullsDown:YES and dummy first item - normal?
  • Next by Date: RE: How to synchronize two managedObjectContexts...
  • Previous by thread: Re: Looking for [NSNumber numberWithString:]
  • Next by thread: Re: Looking for [NSNumber numberWithString:]
  • Index(es):
    • Date
    • Thread