Adding UIBarButtonItem to UINav..Controller
- by mlecho
i am not sure what i am missing here. I Have a custom UINavigationController and i am trying to add a persistant UIBarButtonItem to the bar.
-(void)viewDidLoad
{
self.navigationBar.barStyle = UIBarStyleBlack;
UIBarButtonItem *bbi = [[UIBarButtonItem alloc] initWithTitle:@"Nope..."
style:UIBarButtonItemStyleBordered
target:self
action:@selector(goBack:)];
self.navigationItem.leftBarButtonItem =bbi;
[bbi release];
}
-(void)goBack:(id)sender
{
NSLog(@"go back now");
}
what am i missing here? - BTW, i do not want to/ will not use IB.