I added a button from the code above the "view controller":
@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");
}
... But how can I hide the button?
source
share