Showing posts with label int to string. Show all posts
Showing posts with label int to string. Show all posts

Friday, June 10, 2011

Converting NSString to int and Vice Versa

int to NSString

The following example displays an integer's value as a text label:
currentScoreLabel.text = [NSString stringWithFormat:@"%d", currentScore];


NSString to int

The following example displays a text value as a integer:
int currentScore=[currentScoreLabel.text intValue];

Followers