Question

I'm using a Container View control through interface builder to embedded a UINavigationController and its stack into my app.

The problem I'm having is that the back button does not work on all pushed VCs over the Root VC.

You press the automatically generated back button on these pushed VCs and nothing happens.

Edit:

There is no code written. Its all set up in IB at the moment.

enter image description here

As you can see...Container View with its embedded view controller set to the UInavigation Controller. The whitespace on the left will be a swipeable menu eventually - thats the reason for the set up. Then there's a next button on the root RV which segues to a second view controller.

enter image description here

That state is shown above. Pressing the back button (labelled test) does nothing. Normally it would pop the top view controller and go back to 'test'. Clearly the embedding is interfering with the normal UINavigiationController function somehow.

I just dont know how.

Another Edit:

Making a custom button on that top View Controller and manually calling

   [self.navigationController popViewControllerAnimated:true];

Actually works and the top view controller is removed from the stack.

So the question is why does the back button not work?

Was it helpful?

Solution

I had a similar problem when I forgot that I added a tap gesture recognizer to my navigation bar. The back button actually received touches (pushed state) but as in your example did nothing. A custom button on the navigation bar worked though. Once I removed the gesture recognizer the back button worked again.

Maybe some other view/or gesture recognizer in your container view is catching the touches...

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top