I'm just learning how to code so thanks for your patience on this simple question.
Here's my code:
- (IBAction)buttonWasPressed:(id)sender {
NSString *buttonName = [sender titleForState:UIControlStateNormal];
if (buttonName == @"Button 1") {
do something
}
How do I compare the title of the button passed as sender to a string?
Much thanks for the help.
See Question&Answers more detail:os