Re: NSString to int (or double) conversion
Re: NSString to int (or double) conversion
- Subject: Re: NSString to int (or double) conversion
- From: Lorenzo <email@hidden>
- Date: Tue, 08 Jul 2003 20:00:35 +0200
Hi Cyprien,
it's very easy:
NSString *theString = @"512";
int theInteger = [theString intValue];
double theDouble = [theString doubleValue];
Just to check that, try this:
NSLog(@"My integer is %d", theInteger );
Also to find everything you can do on string, check NSString.
You can easyly double click on the word "doubleValue" or "intValue" or
"NSString" (and any other API or class name) in your code, holding down the
ALT key, and you will get the documentation page speaking about the APIs.
Best Regards
--
Lorenzo
email: email@hidden
>
>
I'm sorry to ask the same kind of question again, but now I'm trying to
>
convert an NSString (like "512") into an int. (or a double)
>
And I've search the cocoa.mamasam.com, and found nothing.
>
>
Cyprien
_______________________________________________
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.