Search code examples
iphoneuinavigationcontrollerback-buttonuinavigationitem

How to hide the backbutton in uinavigationcontroller


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?


Solution

  • Your above line is wrong. do it with :

     self.navigationController.navigationItem.hidesBackButton = TRUE;