I have a button, and set image for it. How I can remove that image later if I need?
This peace of code does’t works for me:
[sender setImage:nil forState:UIControlStateNormal];
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.
senderneeds to be yourUIButton.The only place
sendermight be valid is if it’s in anIBActioncalled by your button, e.g.:But outside of that, you probably need to connect your button to an
IBOutletand then you can set the image to nil whenever you wish.