2012-03-14 10 views

Odpowiedz

12

zakładając, że masz:

UILabel *myLabel; //instance of your label 
int myInt; //the integer you need to set as text into UILabel 

można to zrobić, i to całkiem proste:

[myLabel setText:[NSString stringWithFormat:@"%d", myInt]]; 

czyli

myLabel.text = [NSString stringWithFormat:@"%d", myInt]; 
2
label.text = [NSString stringWithFormat:@"%i",intNumber]; 
3
NSNumber *number = [NSNumber numberWithInt:yourInt]; 
[yourLabel setText:[number stringValue]]; 
0

Spróbuj tego:

[label setText:[NSString stringWithFormat:@"%d", intValue]];