• 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 to int (or double) conversion
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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.

  • Prev by Date: Re: non-blocking file writes
  • Next by Date: Re: awakeFromNib and windowWillLoad : basic question
  • Previous by thread: Re: NSString to int (or double) conversion
  • Next by thread: Calling Java from obj-c app
  • Index(es):
    • Date
    • Thread