Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Set the title of UIButton

how can I set the title of an UIButton?

like image 545
Leon Avatar asked Nov 30 '22 09:11

Leon


2 Answers

[button setTitle:@"Title" forState:UIControlStateNormal];

The same way you can set separate title if needed for highlighted and selected state (changing last parameter)

like image 147
Vladimir Avatar answered Dec 05 '22 02:12

Vladimir


//PSEUDO CODE

UIButton *myButton;

[myButton setTitle: @"I'm a f%&%$$%&& button!!!!!!!! yay" forState:UIControlStateNormal];
like image 26
cocos2dbeginner Avatar answered Dec 05 '22 00:12

cocos2dbeginner