• 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: display int in cocoa
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: display int in cocoa


  • Subject: Re: display int in cocoa
  • From: "I. Savant" <email@hidden>
  • Date: Wed, 10 Oct 2007 14:19:51 -0400

> ... so is there a way to
> cast an int to NSString?

  Two ways off the top of my head:

int x = 0;
NSString * numberString = [[NSNumber numberWithInt:x] stringValue];

  -or-

int x = 0;
NSString * numberString = [NSString stringWithFormat:@"%i", x];

--
I.S.
_______________________________________________

Cocoa-dev mailing list (email@hidden)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

References: 
 >display int in cocoa (From: "Erfan Aleemullah" <email@hidden>)

  • Prev by Date: Re: display int in cocoa
  • Next by Date: Re: Showing an error message when the string entered in the NSTableView is too long
  • Previous by thread: Re: display int in cocoa
  • Next by thread: Re: display int in cocoa
  • Index(es):
    • Date
    • Thread