I have a UIbutton title that I set with
[[buttons objectAtIndex:selectedButtonTag] setTitle:file forState:UIControlStateNormal];
This for some reason doesnt force the button to change title.
When I print the title of the button with
UIButton *button = [buttons objectAtIndex:selectedButtonTag];
NSLog(@"button text is %@",button.titleLabel.text);
It actually prints the previously set title.
Is there some refresh call on the UI or why isnt the button displaying the title?
To anyone having the same issue and has checked all other options. Make sure the png you use for the UIButton is set in the background image field, rather than the image field.