I am just studying the code, so thank you for your patience on this simple question.
Here is my code:
- (IBAction)buttonWasPressed:(id)sender { NSString *buttonName = [sender titleForState:UIControlStateNormal]; if (buttonName == @"Button 1") { do something }
How to compare the title of a button passed as a sender to a string?
Many thanks for the help.
string ios objective-c
Trevor mckendrick
source share