• 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
doubleValue (for an NSString)
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

doubleValue (for an NSString)


  • Subject: doubleValue (for an NSString)
  • From: Boyd Collier <email@hidden>
  • Date: Thu, 20 Mar 2008 16:13:49 -0700

According to Apple's documents, the selector doubleValue returns 0.0 if the instance of an NSString that is the receiver "doesn’t begin with a valid text representation of a floating-point number." Is there a simple way to distinguish between the string 0.0, which shouldn't be considered illegitimate for my purposes, and the string (for example) X0.0 other than writing extra lines of code to distinguish one case from the other? I know I could use a scanner, but perhaps there's something simple that I'm overlooking.

Boyd_______________________________________________

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: doubleValue (for an NSString)
      • From: Quincey Morris <email@hidden>
  • Prev by Date: Re: yearly NSDraggingInfo -draggedImage question (BEWARE!)
  • Next by Date: Re: Simple messages problem
  • Previous by thread: Re: Simple messages problem
  • Next by thread: Re: doubleValue (for an NSString)
  • Index(es):
    • Date
    • Thread