Reputation: 3444
I have a UITableViewController that I would like to have a left nav button, not the right one. The rightBarButtonItem is grayed out and I cannot delete, nor am I able to add a left one. I guess I am a bit confused and do not understand how to do this in IB. I have attached some screenshot that I think show my issue.
My Result, but i want the home icon on the left:
How IB is set up:
Upvotes: 0
Views: 417
Reputation: 4914
Do not add any bar button item on interface builder, create your button programatically,
If you want to use left button as a back button use:
UIBarButtonItem *btn = [[UIBarButtonItem alloc] initWithImage:yourImage style:UIBarButtonItemStyleBordered target:nil action:nil];
self.navigationItem.backBarButtonItem = btn;
If you have your own method write a yourMethod:
function
UIBarButtonItem *btn = [[UIBarButtonItem alloc] initWithImage:yourImage style:UIBarButtonItemStyleBordered target:self action:@selector(yourMethod:)];
self.navigationItem.leftBarButtonItem = btn;
do not forget to release button if you are not using ARC
Upvotes: 2