0
votes

I have a UINavigationController and when I push one of my views, I have a UINavigationBar on top that I made an ivar for and connected it. Now what I need is that button that is like half square and half arrow on the left of the bar. How would I do this programmatically? All I need it to do is say back and do my back action when it is clicked. How would I do this?

Thanks!

1

1 Answers

1
votes

If you're using a UINaviationController, then each view controller that you push onto it does not need it's own UINavigationBar object set up in the nib or in code. You get it and a back button 'for free' when you push a view controller onto a navigation controller's stack.

So remove the UINavigationBar from your pushed view controller. It could actually be blocking the navigation controller's navigation bar.

If you're using a nib to set up your view controller, you can add a 'simulated element' so that you have a fake navigation bar in the nib to help lay out your UI elements.

EDIT: in Xcode 4, they're now called 'Simulated Metrics'. Set the 'Top Bar' to simulate a navigation bar in your nib.

enter image description here