The expected behavior is to change the image (from play to pause and from pause to play) when the play action is clicked. This works as expected in version 4.x. In version 3.2 the setImage does not work meaning the setImage does not set the image. Call to imageForState:UIControlStateNormal returns null in 3.2 version. Any ideas?
@interface TestViewController : UIViewController {
IBOutlet UIButton *playButton;
BOOL play;
}
- (IBAction) play:(id)sender;
@end
@implementation TestViewController
- (IBAction) play:(id)sender {
if (play == YES) {
[playButton setImage:[UIImage imageNamed:@"pause"] forState:UIControlStateNormal];
play = NO;
} else {
[playButton setImage:[UIImage imageNamed:@"play"] forState:UIControlStateNormal];
play = YES;
}
//[playButton imageForState:UIControlStateNormal]
}
@end