Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

Programmer

macrumors member
Original poster
Jun 16, 2009
79
0
I have a an NSInteger in my application called score and i want to show the score integer in a UILabel. I Tried the formatWithObject method but for some reason it did't work.

ScoreLabel.text = [NSString formatWithObject:mad:"%d", (int) score];

Any help is appreciated.
 
Code:
NSString *scoreString = [[NSString alloc] initWithFormat:@"%d", score];
ScoreLabel.text = scoreString;
[scoreString release];
[COLOR="Green"]//you can also use %i conversions for integers[/COLOR]
 
Try this:

textbox.text=[NSString stringWithFormat:mad:"%i", integervariable];
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.