I have a UIViewController with a UITableView in it, and also added a UINavigationBar. How can I add and \"edit\" button and a \"+\" button in that bar programmatically? (I h
Your UIViewController has a navigationItem property. You can set the left and right bar button items with self.navigationItem.leftBarButtonItem = ... and self.navigationItem.rightBarButtonItem = ...
Edit:
OK, I assume you have a reference to your UINavigationBar?
Then I guess you'd add a single UINavigationItem to it:
UINavigationItem *item = [[UINavigationItem alloc] initWithTitle:@"A Title"];
theNavigationBar.items = [NSArray arrayWithObject:item];
[item release]; // or keep this as an instance variable
and then set that item's left and right buttons:
theNavigationBar.topItem.leftBarButtonItem = ...;
theNavigationBar.topItem.rightBarButtonItem = ...;
I haven't tried this, but I think it should work.