Control panel controller does not show the panel button item

I'm new to objetive-c and even more with storyboarding. That being said, I am trying to use a bar button element in a tab bar controller and navigation controller as you can see in the image below.enter image description here

But as soon as I run the project in the simulator, this item is not displayed. I would appreciate a non-software solution if possible.

enter image description here

+3


source to share


2 answers


After spending some time trying to find the best way to do this, I finally did it right from the start. Read the official apple documentation .

Parameters



ViewController The view controller that is pushed onto the stack. This object cannot be an instance of a tab bar controller , and it does not need to be on the stack yet.

In other words, my approach is just a bad design.

+1


source


Ok, so the way to do it is:

When creating a tab display controller. You have to add a navigation controller that will handle each tab.

Tab controller -> Navigation controller -> View controller 1.

Then add a panel button element to view controller 1. Then go and add segues.



Now he still won't show up.

But if you go to your code for your view controller 1: add the link from the storyboard of your panel item to your View Controller 1. Then in ViewWillAppear ():

self.tabBarController.navigationItem.rightBarButtonItem = _btnNewContact;

      

From there it will show up and the segue you set up in your storyboard should work great! =)

+1


source







All Articles