Radislav Radislav - 1 year ago 96
Objective-C Question

How to remove back button from navigation bar

I have that code. It can add edit button to navigatin bar, but back button still exists, but it becomes unresponsible.

UIBarButtonItem *editButton = [[UIBarButtonItem alloc]
initWithTitle:@"Edit"
style:UIBarButtonItemStyleBordered
target:nil
action:nil];
[[self.navigationController.navigationBar.items objectAtIndex:1] setRightBarButtonItem:editButton];

[[self.navigationController.navigationBar.items objectAtIndex:1]setHidesBackButton:YES];

Answer Source

simply and short:

  self.navigationItem.backBarButtonItem = nil;

or

  self.navigationItem.leftBarButtonItem = nil;
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download