Is there a way to have all UIButtons on a view use the same Touch Up Inside handler? Or perhaps set all the buttons to the same delegate using the Interface Builder?
Is there a way to have all UIButton s on a view use the
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Yes. Control drag the first button into the header file the way your normally would and create the action. Then in the .xib file, connect each of the other buttons to File’s Owner and choose the same action that you just created.
In the .xib file, look at the Attributes Inspector on the View pane. You can set the Tag for each button individually. Then you can use the following code…