views:

849

answers:

1

I made a UIView using Interface Builder with a top bar that has Cancel and Save buttons. But when the view is displayed in the simulator it has an extra Navigation bar below the one that I've designed on purpose. The extra bar has no buttons on it. Anyone has a clue where I can look to get rid of the extra nav bar?

Update: While experimenting with removing my "custom" navigation bar and adding it again something changed. I now have the extra navigation bar on top of my custom one and it has a Back-button with the title of the previous view. Don't know how significant this is, but thought I should mention it.

+2  A: 

You're pushing your UIVIew's controller onto an already existing UINavigationController (which comes with its own navigation bar).

What you need to do is get rid of your views "top bar" and access your current controller's navigationItem. Set the close/save buttons using leftBarButtonItem and rightBarButtonItem, possible even the titleView.

August
Thanks. Now I wonder how I "access" the navigationItem. I can see it in my controller's connections list, but I can't connect it anywhere.
PEZ
From your view controller, you can access the navigationItem directly since it's member of the class (self.navigationItem).
codelogic
You mean from the Objective C code? The thing is that I'm trying to use Interface Builder for designing the view. If I must I'll add and connect the buttons from the controller code, but I'm trying to figure out if I can do it from IB.
PEZ