4

how can I set the title of an UIButton?

Leon
  • 417
  • 3
  • 11
  • 24

2 Answers2

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

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

Vladimir
  • 170,431
  • 36
  • 387
  • 313
2

//PSEUDO CODE

UIButton *myButton;

[myButton setTitle: @"I'm a f%&%$$%&& button!!!!!!!! yay" forState:UIControlStateNormal];