I Added a NavigationBar Through IB and I Tried to Add a BarButtonItem Programatically.....But it Doesn't Work.
- (void)viewDidLoad {
UIBarButtonItem *addButton = [[UIBarButtonItem alloc] initWithTitle:@"Edit"style:UIBarButtonItemStyleBordered target:self action:@selector(EditTable:)];
[self.navigationItem setLeftBarButtonItem:self.addButton];
[super viewDidLoad];
}
Try to do this :
self.navigationItem.leftBarButtonItem = [[UIBarButtonItem alloc] initWithTitle:@"Back" style:UIBarButtonItemStylePlain target:self action:@selector(backButtonTapped:)];
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With