So far, I’ve been using
[button1 addTarget:self action:@selector(newAction) forControlEvents:UIControlEventTouchUpInside];
which adds an additional action (I think). How can I replace the initial action with a new one?
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.
You can remove a target for a specific action like this:
Or, better yet, you can remove all targets from your button like this:
Then, you can add your new target action:
That’s pretty much it!