2012-03-14 5 views

Respuesta

12

Suponiendo que tienen:

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

se puede hacer esto, y es bastante simple:

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

o:

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

Pruebe esto:

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