I have two different UIViewControllers
on the same UINavigationController
. Both contain a tableview
.
If one of the cells on the first view controller is tapped, the second controller is pushed.
If one of the cells in the second is pushed, another instance of the second controller is pushed.
When using the back button to go back, this all works perfectly. However, when using iOS 7's interactivePopGestureRecognizer
, moving from one instance of the second view to another causes a crash.
I have statements logging the navigation controller activity and the gesture recognizer start.
This is the output when starting and then canceling the pop gesture:
Push <ViewController2: 0x15597f60>
Will show <ViewController2: 0x15597f60>
Did show <ViewController2: 0x15597f60>
Push <ViewController2: 0x15638b80>
Will show <ViewController2: 0x15638b80>
Did show <ViewController2: 0x15638b80>
Interactive pop started
Will show <ViewController2: 0x15597f60>
-navigationController:didShowViewController:animated:
is never called. After this, attempting the gesture again will take you back to the first view controller (i.e. one pop too many), but the navigation bar will still display a back button and the title of the second view.
And then this is the output when attempting to pop normally:
Push <ViewController2: 0x15597f60>
Will show <ViewController2: 0x15597f60>
Did show <ViewController2: 0x15597f60>
Push <ViewController2: 0x15638b80>
Will show <ViewController2: 0x15638b80>
Did show <ViewController2: 0x15638b80>
Interactive pop started
Will show <ViewController2: 0x15597f60>
Unbalanced calls to begin/end appearance transitions for <ViewController1: 0x156e7050>.
Did show <ViewController1: 0x156e7050>
Any ideas as to why this is occurring?