Do you know how to hide the \'back\' button in a UINavigationController? Also, how to show it back, but I guess that\'s very similar to hiding it...
Just like the ma
Just to clarify existing answers: the hidesBackButton
property is the right answer, but it isn't clear in many answers what self
refers to. Basically you should set self.navigationItem.hidesBackButton = YES
in the view controller that is about to get pushed (or just got pushed) onto the UINavigationController
.
In other words, say I have a UINavigationController
named myNavController
. I want to put a new view on it, and when I do I don't want the back button to show anymore. I could do something like:
UIViewController *newVC = [[UIViewController alloc] init];
//presumably would do some stuff here to set up the new view controller
newVC.navigationItem.hidesBackButton = YES;
[myNavController pushViewController:newVC animated:YES];
When the code finishes, the view controlled by newVC
should now be showing, and no back button should be visible.