Does anyone know how to hide a rightBarButtonItem
of a UINavigationController
? In my application, I have an edit button as a rightBarButtonItem>
Try
self.navigationItem.rightBarButtonItem = nil;
When you want it back though you will have to instanciate a button i.e.
UIBarButtonItem *rightBarButton =
[[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemSearch
target:self
action:@selector(searchBar:)];
self.navigationItem.rightBarButtonItem = rightBarButton;
[rightBarButton release];