So I have a nav controller and I push a view on the screen, a settings view, but I want to remove it out of the hierarchy, so when the new viewcontroller comes onto screen and the back button is pressed it returns it to the main menu.
I tried this:
[self.navigationController popViewControllerAnimated:NO];
[self.navigationController pushViewController:tabBar animated:YES];
But the the viewController is just popped off and the new one is not presented.
You should try to modify the navigationcontrollers view controller array like the following way:
Maybe the animation will be broken. If this happens you should move the part with the modification of the navigationcontroller VC array to the presented VC’s viewDidAppear method.