29

I am new to iOS development and have not tried this programmatically yet. I would prefer to get this working in a storyboard.

I'm following this somewhat outdated tutorial from XCode 4.5 in XCode 6.1 to create a series of views connected by one navigation controller. http://youtu.be/rgd6mCuzlEc

Screenshot

Once I create the second view controller, I am unable to double click the navigation bar to change the name and I am unable to add a bar button to it.

I have a Segue going from bar button "Item" from view 1 to 2. Notice in the "View Controller Scene" there is no navigation item. If I add any elements to the view controller they fall under "View" and not under "View Controller", unlike view controller 1 where it falls under "one".

Is this a limitation on XCode? Am I using the wrong Segue (Show)? Is there a hidden setting or customization I'm missing?

I actually have this working for 2 view controllers and failing the 3rd in a separate project but I don't know what I did to do that so I'm pretty sure it's possible I just cannot reproduce..

EDIT: Workaround Instead of the new adaptive SHOW segue, use the deprecated PUSH segue, add the bar button items, then change back to the adaptive SHOW segue.

Daniel E
  • 529
  • 1
  • 4
  • 18

1 Answers1

52

Try adding a Navigation Item to the controller and it should work properly

enter image description here

Mehdi Bn
  • 5
  • 4
KristofferArl
  • 701
  • 6
  • 6
  • 1
    I also found a workaround that seems to automatically add the item for you but this is the correct answer. Thank you! – Daniel E Dec 03 '14 at 02:00
  • Just to add to this solution, I didn't have to link the navigationItem to the class at all. I just dragged and dropped into into the UIViewController and linked a barbuttonItem I needed. Even changing the navigationItem's title works programatically without linking. – Jargen89 Feb 27 '15 at 14:38
  • @DanielE: Glad I found this comment!! However it begs the question of why it needs to be done this way? Is there a correct way of doing this? – gone Mar 20 '16 at 07:17
  • Perfect Thanks :) – Naresh Reddy M Sep 29 '16 at 07:31
  • You have no idea how long it took me to find this. THANK YOU! – barrylachapelle Nov 22 '18 at 21:50