Here’s my code:
UIBarButtonItem *leftButton = [[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemDone target:self action:@selector(rightButtonPressed)];
[self.navigationItem setLeftBarButtonItem:leftButton];
[leftButton release];
The ‘self’ class is inherited form an UINavigationController and is I presenting it from an other UIViewController with the ‘presentModalViewController’ method.
What do you think? Why isn’t displaying the left button?
This code should be placed inside a view controller that is on the navigation controllers navigation stack, not a UINavigationController subclass.
Naviation items are properties of view controllers that will be placed in navigation controllers. You shouldn’t be using the navigation item property of a navigation controller itself.