I’m setting a new stack of ViewControllers to my navigationController by doing the following:
MainMenuViewController *mainMenuViewController = [[MainMenuViewController alloc] init];
NSArray *controllerArray = [NSArray arrayWithObject:mainMenuViewController];
[mainMenuViewController release];
[self.navController setViewControllers:controllerArray animated:YES];
The only problem is I can’t seem to set the transitional style. Ideally I’d like it to flip. Is this possible? It’s important that I use setViewControllers:animated rather than presentModalViewController since I switch back and forth between stacks and want to maintain the navigation control behaviours for each.
Instead of swapping out entire navigation stacks, why not just maintain two navigation controllers and animate a transition between them? Seems cleaner to me.
UPDATE
I guess I could be of better assistance if I knew what you were trying to achieve, but I know that you can present a second nav controller modally from a first, and you can push a bunch of views onto it before/after presentation, etc. Also, out-and-out replacement of an existing stack of view controllers, especially if it’s deep, may confuse the user, not to mention the Apple review team.
Maintaining two nav controllers in memory is not necessarily a big deal, as long as you have the memory (you probably do), and as long as the user is actually getting benefit.
Perhaps you can shed some light on your high-level purpose and we can go from there.
MORE
If you want it to flip, then you can set
navController2.modalTranstitionStyle = UIModalTransitionStyleFlipHorizontal, which will causenavController2to flip in when it is presented modally.SO had some weird glitch about the time we were commenting below, it might have lost your updates.