How can I start and stop image animation using button control?
imageView.animationImages = [NSArray arrayWithObjects:
[UIImage imageNamed:@"p1.jpg"],[UIImage imageNamed:@"p2.jpg"], [UIImage imageNamed:@"p3.jpg"],[UIImage imageNamed:@"p4.jpg"],[UIImage imageNamed:@"p5.jpg"],[UIImage imageNamed:@"p6.jpg"], nil];
imageView.animationDuration = 1.00; //1 second
imageView.animationRepeatCount = 0; //infinite
[imageView startAnimating]; //start the animation
Add two buttons using Interface Builder, create two
IBActionmethods in your controller, connectTouch Up Insideevents with the IBActions.Use
[imageView startAnimating]to start,[imageView stopAnimating]to stop.