views:

448

answers:

1

In Interface builder, create a UIView, then a UINavigationBar and then attempt to add multiple UIBarButtomItems to that Navigation Bar. The resulting hierarchy should be:

- View
  - Navigation Bar
    - Navigation Item (Title)
      - Bar Button Item 
      - Bar Buttom Item

I can never seem to add the second Bar Button Item. I know it is possible because the Utility Application Template in XCode has it. If I copy and past that Navigation Bar to my XIB it works fine. I am looking to create a NavigationBar with left, right button and middle text.

UPDATE

Another test is to try and add a Bar Buttom Item to the left position. Can't seem to do it for me at least.

What am I missing here?

+1  A: 

I have no problem doing this in 3.2 beta 2. Just make sure to drag it to the left or right side. A blue outline will appear where the button will be placed.

Edit:

I've managed to reproduce what you're talking about. When I did it successfully, I dragged the item to the "pretty picture", the graphical representation of the view. When I tried dragging it into the view hierarchy, I ran into your problem. Have you tried dragging the button to the actual Navigation Bar? I hope this is clear, I'm not really sure what to call this window.

David Kanarek
I am using Version 3.2.1 (740), and simply cannot do it. It's almost like I need to make one left and one right. The indented blue line just doesn't appear. I can add it to root or the same level as Navigation Item, but not as a child of Navigation Item which is what I need.
jr
@David. Thanks! At least I know I'm not crazy! Open up an example Utility Application and you will see that it works. I can't find anything different between that XIB and mine as far as properties go. I have tried dragging it just about everywhere!
jr
What happens if you start a new IB project, drag a nav bar into the view, then drag in a button to each side? Maybe your project is messed up? I'm running this on 3.2.2 (760) so you could try updating I suppose, but I kinda doubt it will help.
David Kanarek
You are right. You need to drag it to actual graphical VIEW (where it is displayed) and not the Window where File's Owner and First Responder are found.
jr
Glad you got it working. This seems really stupid to me, a bug or oversight on Apple's part.
David Kanarek
I agree. You should be able to drag it to the outline and then link it to the left button or right button respectively. If you drag it to the outline you can't disconnect the right button link.
jr