views:

52

answers:

1

I'm running SDK 3.2.3 I have a simple tab bar controller with three view controllers. Each view controller has an NSArray of images for a simple animation. The animation runs a loop when each of the tabs is pushed however if you go back to tab one after you've pressed another tab, the animation doesn't run again. Any code I could put in here to have it run again and again? help would be much appreciated.

A: 

You should consider to stop your animation on the viewWillDissappear method and start it again in the viewWillAppear.

Anyway, if you dont paste ypur code is very difficult to help you

Angel García Olloqui
I'm running it right after ViewDidLoad method which follows an IBAction. I don't have a viewWillDisappear method.- (void)viewDidLoad { imageView.animationImages = [NSArray arrayWithObjects: [UIImage imageNamed:@"Hippo1.png"],[UIImage imageNamed:@"Hippo2.png"],[UIImage imageNamed:@"Hippo3.png"],[UIImage imageNamed:@"Hippo4.png"],[UIImage imageNamed:@"Hippo11.png"], nil]; imageView.animationRepeatCount = 0; imageView.animationDuration = 1; [imageView startAnimating]; [self.view addSubview:imageView]; [super viewDidLoad];}
Nick
- (void)viewDidLoad { imageView.animationImages = [NSArray arrayWithObjects: [UIImage imageNamed:@"Hippo1.png"], [UIImage imageNamed:@"Hippo2.png"], [UIImage imageNamed:@"Hippo3.png"], [UIImage imageNamed:@"Hippo4.png"], [UIImage imageNamed:@"Hippo5.png"], [UIImage imageNamed:@"Hippo6.png"], nil]; imageView.animationRepeatCount = 0; imageView.animationDuration = 1; [imageView startAnimating]; [self.view addSubview:imageView]; [super viewDidLoad];}
Nick