Вопрос

In my storyboard I have a tableview with buttons. I want to custom assign float and int value to the button.

I have assigned a label with players.text= Player.player; but I don't know to assign the button with float or int value.

Это было полезно?

Решение

This is how to set button title,

for int value:

[button setTitle:[NSString stringWithFormat:@"%i", intValue] forState:UIControlStateNormal];

for float value:

[button setTitle:[NSString stringWithFormat:@"%0.1f", floatValue] forState:UIControlStateNormal];
Лицензировано под: CC-BY-SA с атрибуция
Не связан с StackOverflow
scroll top