I need to send extra arguments to a method on button press, but can’t find a way to make addTarget send a selector to do that.
I’d rather use a block anyway, but is there a method for attaching a block to a UIButton at run time?
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.
Not by default. You could subclass UIButton to make this happen, though. Someone did it here.