I keep forgetting how to do this so here it is: if you have an integer and you want to print it out, say in a UILabel you can use the initWithFormat method of NSString like so:
1 2 3 |
NSString *myNumber; myNumber = [[NSString alloc] initWithFormat:@"%d", myInteger]; self.myLabel.text = myNumber; |
The secret here is the @”%d” which is called a String Format Specifier (search for it in the Developer Docs).