When modifying properties directly on a UIButton
's label (titleLabel
), the changes may be discarded when the state of the parent UIButton
changes.
This is due to directly modifying the UILabel
properties rather than going through the UIButton
designated methods.
For example, UIButton
maintains an internal pairing of UIControlState
to NSString
values that are set when updated through the designated setter -setTitle:forState:
. Modification of the button's title directly via the label may be overridden by the button based on its title/control state mapping.