I am breaking the normal paradigm of a UINavigationController, or at least I'm trying to.
We know that the Navigation Controller manages navigation via a stack. If I initialize with root controller A, navigate to B, and then Navigate to C, the Stack will look like - C/B/A.
What I want to do though, is have a button on view C that will show another view, say X, but still keep the Navigation Controller's nav bar in place. Essentially, switch "C" and "X" on the stack. I tried to accomplish that by popping C off and immediately pushing X as shown below, but it didn't work. Am I going down the wrong path here?
-(IBAction)showViewX:(id)sender {
[[self.parentViewController navigationController] popViewControllerAnimated:NO];
XViewController *xViewController = [[XViewController alloc]
initWithNibName:@"X"
bundle:[NSBundle mainBundle]];
[[self.parentViewController navigationController] pushViewController: xViewController animated:YES];
[xViewController release];
}