I have added a button from the code above \"view controller\":
@implementation HBViewController
.....
.....
.....
- (void)viewDidLoad
{
[super view
//to disable
self.navigationItem.rightBarButtonItem.enabled = NO;
//to hide - hide means setting nil will remove that button
self.navigationItem.rightBarButtonItem = nil;
//if u want to show again then create and assign new button again
okButton = [[UIBarButtonItem alloc] initWithTitle:@"Ok"
style:UIBarButtonItemStyleBordered
target:self action:@selector(okayButtonPressed)];
[self.navigationItem setRightBarButtonItem:okButton animated:NO];