2

Trying to back to previous viewController, but animation in iOS5 not working.

- (IBAction)backToPreviousController
{
    [self.navigationController popViewControllerAnimated:YES];
}

Can somebody help me?

CRABOLO
  • 8,605
  • 39
  • 41
  • 68
  • 4
    add NSLogs to make sure that 1. the method is actually called and 2. self.navigationController is not nil. – Matthias Bauch Jan 14 '12 at 09:45
  • 2
    this works definitely. there is no problem with this method. problem will be somewhere else in your code – Saurabh Passolia Jan 14 '12 at 09:48
  • I'am returning to the previous viewController, but without animation. In the iOS4 works great, – Davey Jones Jan 14 '12 at 09:56
  • Where are you calling `backToPreviousController`? Looks like it's from a button tap or something (due to the `IBAction`) but is it possible you're calling it from somewhere else which could have an effect. Also, do you see no animation at all and it just pops right to the previous view or do you see some animation? – mattjgalloway Jan 14 '12 at 13:03

1 Answers1

2

From the OP, Davey Jones~

Problem solved by adding animation manually

CATransition *transition = [CATransition animation]; 
transition.duration = 0.5; 
transition.timingFunction = [CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionDefault]; 
transition.type = kCATransitionPush; 
transition.subtype = kCATransitionFromLeft; 
[self.navigationController.view.layer addAnimation:transition forKey:nil]; 
Community
  • 1
  • 1
CRABOLO
  • 8,605
  • 39
  • 41
  • 68