about two questions
/*
1. この [_playerImageView setImage:_imageData[1]]
what can it do ? why ?
2. [_playerImageView startAnimating] と [_playerImageView setImage:_imageData[1]] のシーケンスが結果に与える影響 */
- (void)loadDataAndAnimation
{
_imageData =@[[UIImage imageNamed:@"a"],
[UIImage imageNamed:@"b"],
[UIImage imageNamed:@"c"]];
[_playerImageView setAnimationImages:self.imageData];
[_playerImageView setAnimationDuration:5.0];
[_playerImageView startAnimating];
}
- (void)viewDidLoad
{
[super viewDidLoad];
[self loadDataAndAnimation];
}
- (IBAction)playGame:(UIButton *)sender
{
NSLog(@"%d",sender.tag);
if ([_playerImageView isAnimating])
{
NSLog(@"stop");
[_playerImageView stopAnimating];
[_playerImageView setImage:_imageData[sender.tag]];
}else
{
NSLog(@"start");
[_playerImageView startAnimating];
// something wrong ?
[_playerImageView setImage:_imageData[1]];
}
}