0

Really weird issue, i've got a view (view 2) that i'm popping to bring up my main view (view 1) which has an animated background. Once i pop from view 2, view 1 loses those animations... the weird thing is that moving the iOS status bar in the slightest will restart them!

Any ideas?

This is the code that i'm using to pop the view. If I pop the view without animations, it works fine.

-(IBAction)popOnSwipe {
[UIView beginAnimations:@"" context:nil];
[UIView setAnimationDuration:0.75];
[UIView setAnimationCurve:UIViewAnimationTransitionCurlDown];
[UIView setAnimationTransition:UIViewAnimationTransitionCurlUp forView:self.navigationController.view cache:NO];
[navController popViewControllerAnimated:NO];
[UIView commitAnimations];

One more thing; the animation starts back up on the simulator, but not on the iTouch i'm testing it on. Any insight would be greatly appreciated,

thanks!

LarryFisherman
  • 322
  • 2
  • 11

2 Answers2

0

Add your animations for view1 in DidStopSelector method like,

-(IBAction)popOnSwipe 
{
[UIView beginAnimations:@"" context:nil];
[UIView setAnimationDuration:0.75];
[UIView setAnimationCurve:UIViewAnimationTransitionCurlDown];
[UIView setAnimationTransition:UIViewAnimationTransitionCurlUp forView:self.navigationController.view cache:NO];
[UIView setAnimationDidStopSelector:@selector(view1_animation)];//add this line
[navController popViewControllerAnimated:NO];
[UIView commitAnimations];
}
-(void)view1_animation
{
  //do animations for view1
}
Madhumitha
  • 3,794
  • 8
  • 30
  • 45
  • Thanks for your answer, but I don't think that this is what I need. I simply have an ImageView array on View 1 that is animated through the use of `testImage.animationImages = myArray; [testImage startAnimating]` A key thing to note is that it works in simulator. I have no idea what the underlying issue is. – LarryFisherman Jul 25 '12 at 07:22
  • add this testImage.animationImages = myArray; [testImage startAnimating] in -(void)view1_animation. – Madhumitha Jul 25 '12 at 07:36
0

The device I was using was faulty, the method works fine on my other devices. Thanks for the help.

LarryFisherman
  • 322
  • 2
  • 11