Change the name of UIButton

I want to switch the button text based on clicks - every time the button is clicked, the title will change from textA to TextB and so on. but when I use button.titlelabel.text = @"blabla" but the text remains the same.

+3
source share
2 answers

It is worth a try:

-(IBAction)buttonClickEvent 
{
   [button setTitle:@"your title" forState:UIControlStateNormal];
}
+9
source
- (void)setTitle:(NSString *)title forState:(UIControlState)state
+2
source

Source: https://habr.com/ru/post/1794414/


All Articles