Re: NSString's intValue method
Re: NSString's intValue method
- Subject: Re: NSString's intValue method
- From: "Louis C. Sacha" <email@hidden>
- Date: Mon, 19 Apr 2004 00:50:36 -0700
Hello...
You could probably just use doubleValue and let the compiler do the
conversion for you...
unsigned myValue = [yourString doubleValue];
Also, NSScanner has a scanLongLong: method for extracting long longs
(64 bits) that you could use, which should allow you to extract the
full number as an integer if you want.
long long veryLong = 0;
[[NSScanner scannerWithString:yourString] scanLongLong:&veryLong];
unsigned myValue = veryLong;
Hope that helps,
Louis
I have a NSString that contains an unsigned int value,
I am trying to get that value out, but if it is greater then the int max value
it always returns INT_MAX, but that is probably because I am using
NSString's intValue method which returns an integer and not the
unsigned int that I desire.
Any way to do this?
Thanks,
Matt
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.