Reputation: 2822
I tried to remove the backbutton of uinavigationcontroller by using
appdelegate.navigationController.navigationItem.hidesBackButton=YES;
but it does not remove the backbutton after the pushing a new viewcontroller into navigation stack.How to hide this?
Upvotes: 2
Views: 4902
Reputation: 783
The existing answers didn't work for me. I found that the best way for me was:
self.navigationItem.leftBarButtonItems = [NSArray array];
Upvotes: 0
Reputation: 2472
You can write this in your ViewDidLoad
as well as in ViewWillAppear
method:
self.navigationItem.hidesBackButton = YES;
Upvotes: 0
Reputation: 3515
Your above line is wrong. do it with :
self.navigationController.navigationItem.hidesBackButton = TRUE;
Upvotes: 2
Reputation: 7931
In the view controller's viewDidLoad method that you want to hide the back button:
self.navigationItem.hidesBackButton = YES;
Upvotes: 12