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

Re: NSString intValue


  • Subject: Re: NSString intValue
  • From: Ondra Cada <email@hidden>
  • Date: Tue, 2 May 2006 23:07:11 +0200

Boyd,

On 2.5.2006, at 23:01, Boyd Collier wrote:

The integer value of the receiver’s text, assuming a decimal representation and skipping whitespace at the beginning of the string. Returns INT_MAX or INT_MIN on overflow. Returns 0 if the receiver doesn’t begin with a valid decimal text representation of a number.
Thus, the string @"0" returns 0, which for my purposes is acceptable, but a string such as @"X" also returns 0, which isn't acceptable.

Depends. I've always found this an extremely convenient convention, one which makes my programmer life much easier.


Is there an easy way to distinguish between these two situations, or do I have to write a bunch of extra code to distinguish between them?

A one-liner with rangeOfCharacterFromSet:, rather :) --- Ondra Čada OCSoftware: email@hidden http://www.ocs.cz private email@hidden http://www.ocs.cz/oc


_______________________________________________ Do not post admin requests to the list. They will be ignored. Cocoa-dev mailing list (email@hidden) Help/Unsubscribe/Update your Subscription: This email sent to email@hidden
References: 
 >NSString intValue (From: Boyd Collier <email@hidden>)

  • Prev by Date: Re: NSString intValue
  • Next by Date: Re: NSTokenField, how to query the selection?
  • Previous by thread: Re: NSString intValue
  • Next by thread: can't get DOMDocument from WebView
  • Index(es):
    • Date
    • Thread