Ios – Can’t do ANYTHING with navigation bar

iosuinavigationbaruinavigationcontrolleruitabbarcontroller

I have this structure:

storyboard screenshot

When I want to add a ´UINavigationItem´ from the storyboard the navigation bar is "disabled", so I tried to add the right button programatically:

UIBarButtonItem *button = [[UIBarButtonItem alloc]
                           initWithBarButtonSystemItem:UIBarButtonSystemItemAdd
                           target:self
                           action:@selector(showPickerView:)];
self.navigationItem.rightBarButtonItem = button;

But nothing happens. I renamed the navigation bar title from storyboard, but when I run the app the title is not set. I really don't know what is the source of the problem. There is just the back button that is appearing.
Thank you for your help.

Best Answer

Each item in the tab bar controller should have a navigation controller as the root controller (well, you don't need all of them to have a nav controller if you don't need them). What you currently have is a tab bar controller in the navigation controller (unless it's modal) so the view controllers contained in the tab bar controller can't see out to the navigation controller.