Whenever a child view is pushed into the Navigation Controller, a back button on the top left of the page is displayed. Using this button the user can go back to the parent view. In some case we like not to display that button e.g. if we want to add an Cancel and Save button on the screen. Cancel acts like a back button and does not save anything. The Save button does validation and saves the data.In this case we don’t want user to simply touch the Back button and go back to parent view.

It is a single line of code that can be added in the viewDidLoad method to hide the back button in UINavigationBar is as follows.


[ self.navigationItemsetHidesBackButton:YES animated:YES];