Im trying this, but when i press it it dont changes, it only displays text.
Also tried if else functions, but with no results.
.h
IBOutlet UIButton *poga1;
@property (nonatomic, retain) UIButton *poga1;
.m
@synthesize poga1;
- (void)viewDidLoad
{
[super viewDidLoad];
[poga1 setTitle:@"My Title" forState:UIControlStateNormal];
[poga1 setTitle:@"My Selected Title" forState:UIControlStateSelected];
}
Try this: If you added a title through the storyboard (the gui interface) then delete it.
.h
//create an IBOutlet action. How? You right-click the button and drag it to the .h file. A pop up happens and you need to click the drop down and switch it to action
//should be something like
/* if you want this to change the text each time it’s pressed then, you need a global counter that your increment each time the button is pressed. then you will have a if statement saying if the counter is equal to 1 (pressed once) then set title to hello, if the counter is equal to 7 (pressed 7 times) set title to goodbye. */