views:

1021

answers:

4

I'm using a navigation controller to drill into a detail view when a cell is tapped. When I push my view controller onto the navigation controllers stack, I expect to see a back button that I can tap to pop the previous view off the stack.

The issue is that the back button isn't visible, but when tapping where it should be returns me to the previous view. What's the problem?

+4  A: 

Ensure you have set a title for the master view - for example in viewDidLoad add this -

self.title = @"The Title";

Weirdly, if there is no title for the parent view controller on the stack, rather than show an empty back button, the iPhone will not display a button but will allow taps on the area where it should be.

This bugged me for a long time!

Robert Conn
this bugged me for a bit today as well - not that obvious.
Lee
A: 

Hi Robert,

I am also looking add back button on pushed View Controller. I have disable Navigation bar on top and also hideBottombar when view controller pushed.

I have attached xib file with pushed view controller. I have created WebView on that pushed View, now I like to show back button on that,how to add back button on that view and show on view?

Once Back button will show on view, i want it to not visible all time but only when user tap on screen, how to add that?

Thanks,

TechFusion
+1  A: 

At least as of iPhone 3.0, you can also avoid the dreaded invisible back button by setting a title on the root controller's navigation item in your main window's nib (MainWindow.xib in wizard-generated projects).

Patrick Linskey
That did the trick... Thanks
Kevin
A: 

Lets see if this helps you.

I had the same issue where I used a navigation based application and set up my search, rotation etc.. BUT, when I clicked on the table cell I was directed to the next view but that view did not have a back button present.

I tried to add a title to the back button but that did not work so this is what I did.

I opened the mainWindow.xib file and added a Bar Button Item to the group of other items inisde the window (where the file's owner is located). I then assigned an image to the button (you can add text here if you want). Then I clicked on the Navigation Item and hit command 2 to open up the Navigation item connections and chose the back bar button item and dragged it to the bar button item I wanted to use for my back button. And there you have it.

Wes Duff