I want to call a new view controller and remove the current view controller from the navigation controller stack. For example. I am in view controller A and I call B.
<
This is the answer.
The following code pops the current view controller.
UINavigationController *navController = self.navigationController;
// retain ourselves so that the controller will still exist once it's popped off
[[self retain] autorelease];
[navController popViewControllerAnimated:NO];
And this pushes the new one:
ViewControllerC *viewC = [[ViewControllerC alloc] init];
[navController pushViewController:viewC animated:TRUE];
Hope it helps!