popViewControllerAnimated animation not working in iOS5

1.5k views Asked by At

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

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

Can somebody help me?

1

There are 1 answers

0
CRABOLO On

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];