IOS: one IBAction for multiple buttons
If you’re using interface builder to create the buttons, simply point them at the same IBAction in the relevant class. You can then differentiate between the buttons within the IBAction method either by reading the text from the button… – (IBAction)buttonClicked:(id)sender { NSLog(@”Button pressed: %@”, [sender currentTitle]); } …or by setting the tag property in … Read more