Re: NSString intValue
Re: NSString intValue
- Subject: Re: NSString intValue
- From: "Shawn Erickson" <email@hidden>
- Date: Wed, 3 May 2006 08:02:24 -0700
On 5/2/06, Boyd Collier <email@hidden> wrote:
Thanks for the quick reply. I had already tried NSScanner's scanInt:
and the problem with it is that if a user enters, for example, 5X, it
returns 5 and doesn't signal a problem. However, your suggestion
prompted me to look more closely at other NSScanner methods, and I
found isAtEnd: So it appears that I can use this to identify
situations in which the user has some characters that can't represent
an integer following those that can.
You trying to validate user input? Have you looked at NSNumberFormatter?
-Shawn
_______________________________________________
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