turn int to NSString?
ok, in my sidescroller I now have mouse controlled aiming (with two different weapons), and enemies that die. Now I need to draw your score to the screen, at the moment I have your score stored as an int, what's the code to change it into an NSString? (in RB I used the "str" function).
Thanks,
Phate
Thanks,
Phate
Code:
[NSString stringWithFormat:@"%d", myInt]
Do something along the lines of:
This will print out "Your score is 20".
Code:
NSString *myString;
myString = [NSString stringWithFormat: @Your score is "%d", 20;
NSLog (myString);This will print out "Your score is 20".
Possibly Related Threads...
| Thread: | Author | Replies: | Views: | Last Post | |
| Best Engine/Framework For iPhone Turn Based Strategy? | Brawnydt | 6 | 5,531 |
Oct 11, 2010 06:47 PM Last Post: MattDiamond |
|
| Malloc() Struct with NSString Inside? | Graphic Ace | 3 | 3,784 |
Jan 26, 2010 05:32 PM Last Post: cmiller |
|
| Browser Based.. Updating turn times? | guest_05 | 1 | 2,612 |
May 24, 2007 04:03 PM Last Post: Tobs_ |
|
| Can't use NSString to put a number on screen? | kensuguro | 3 | 4,195 |
Nov 7, 2005 01:16 AM Last Post: Jordan |
|
| Getting Number From Character In NSString | Nick | 2 | 3,813 |
Oct 31, 2005 10:08 AM Last Post: Nick |
|

