You should use setTitle:forState: to change the title of a UIButton
. If you change the title yourself, the button has no indication that it needs to resize the label – you’d end up having to do something like this:
myButton.titleLabel.text = @"this is the new label";
[myButton setNeedsLayout];
but I’m not even sure that would work in all cases. Methods like setTitle:forState:
are provided so that you can provide titles for multiple states without having to update the button manually, and so that the button knows that it needs to be laid out with a new title.