我从“视图控制器”上方的代码中添加了一个按钮:
@implementation HBViewController
.....
.....
.....
- (void)viewDidLoad
{
[super viewDidLoad];
okButton = [[UIBarButtonItem alloc] initWithTitle:@"Ok" style:UIBarButtonItemStyleBordered target:self action:@selector(okayButtonPressed)];
[self.navigationItem setRightBarButtonItem:okButton animated:NO];
}
- (void) okayButtonPressed{
NSLog(@"you pressed ok");
}
...但是我怎样才能隐藏按钮?