I have a root view, and several child views. For each view, I have an info button which causes the view to flip over to reveal an info screen. My problem is that when I flip back, using the back button, it doesn't take me to the screen I'd left -- it takes me back to the root view. It was fine before I went through all the work of adding the flip instead of the usual push!
in a viewController (I'll call it detailViewController) that is 3 pages into the hierarchy:
- (void)infoAction {
infoViewController *controller = [[[infoViewController alloc] init] autorelease];
[self.navigationController pushViewController:controller animated:NO];
}
In that infoViewController:
-(void)viewWillAppear:(BOOL)animated{
[super viewWillAppear:animated];
[UIView beginAnimations:@"animation" context:nil];
[UIView setAnimationDuration:0.8];
[UIView setAnimationTransition:UIViewAnimationTransitionFlipFromLeft forView:self.navigationController.view cache:NO];
[UIView commitAnimations];
}
-(void) viewWillDisappear: (BOOL) animated{
[super viewWillDisappear:animated];
[self.navigationController popViewControllerAnimated:YES];
[UIView beginAnimations:@"animation" context:nil];
[UIView setAnimationDuration:0.8];
[UIView setAnimationTransition:UIViewAnimationTransitionFlipFromRight forView:self.navigationController.view cache:NO];
[UIView commitAnimations];
}
It isn't flipping me back to the "detailViewController". It is taking me back to the first opening screen view.
By the way, in the info screen's navigation bar, the back button is properly labelled with the detailViewController title, not the root view title, even though tapping that back button doesn't take you where it says it will! Please help...Thank you!