I have written 1 code for
-(IBAction)action:(UIEvent *)id
{
[act setImage:[UIImage imageNamed:@"down.png"] forState:UIControlStateHighlighted];
}
It’s working, but I have written 1 code for
-(IBAction)action:(UIEvent *)id
{
[act setImage:[UIImage imageNamed:@"down.png"] forState:UIControlStateHighlighted];
}
And after that I had written code for communication with server.
Now the setImage: line is not working.
What should I do?
The most likely explanation is that you did not get the outlet for the control that calls the action wired to the action in interface builder.
First, you should set a break point in the method to see if it even gets called. If it doesn’t, check interface builder and hook up the proper connection. If it does get called, but the image is still not set, the problem is most likely that
[UIImage imageNamed:@"down.png"]is returning a nil.