I am new to iPhone programming and when I use this code to enable/disable a button nothing happens. I connected my button through an IBOutlet and I know when I disable it in viewDidLoad it works. I just cant figure out why this method isn’t working.
- (void) multiplicationButtonPressed {
if (multiplicationIsPressed) {
multiplicationButton.enabled = NO;
} else {
multiplicationButton.enabled = YES;
}
}
Please Check that your IBOutlet had connected properly for this button or not and then
use this piece of code
That’s it. You don’t need to have any boolean flag. It works like toggle.