For my program, I would like an array of buttons, one for each letter in the alphabet. When the user presses a button, I would like a variable to be set to the value of the button pressed, and for a search for that value to be performed in many strings. How can I access only the value of the button pressed within the -(IBActon) without making 26 separate outlets for each button?
Share
You can set up the IBAction so that the button triggering the event is passed into the method. You can use that argument to work out which letter was pressed, and only have one action for all the buttons: