Когда я нажимаю кнопку, я хотел бы запустить последовательность методов methodOne, затем methodTwo, затем methodThree. Когда я запускаю его сейчас, я запускаю только последний метод. Я бы хотел, чтобы они работали по порядку. Что я делаю не так.
@implementation JackAnimationViewController
@synthesize color;
- (IBAction)button:(id)sender {
[self methodOne];
[self methodTwo];
[self methodThree];
}
-(void) methodOne{
color.animationImages = [NSArray arrayWithObjects:
[UIImage imageNamed:@"greenDim.png"],
[UIImage imageNamed:@"GreenPressed.png"],
[UIImage imageNamed:@"greenDim.png"],
[UIImage imageNamed:@"GreenPressed.png"],nil];
[color setAnimationRepeatCount:2];
color.animationDuration = 1;
[color startAnimating];}
-(void) methodTwo{
color.animationImages = [NSArray arrayWithObjects:
[UIImage imageNamed:@"yellowDim.png"],
[UIImage imageNamed:@"YellowPressed.png"],
[UIImage imageNamed:@"yellowDim.png"],
[UIImage imageNamed:@"YellowPressed.png"],nil];
[color setAnimationRepeatCount:2];
color.animationDuration = 1;
[color startAnimating];}
-(void) methodThree{
color.animationImages = [NSArray arrayWithObjects:
[UIImage imageNamed:@"yellowDim.png"],
[UIImage imageNamed:@"GreenPressed.png"],
[UIImage imageNamed:@"yellowDim.png"],
[UIImage imageNamed:@"GreenPressed.png"],nil];
[color setAnimationRepeatCount:2];
color.animationDuration = 1;
[color startAnimating];}
@end