tags:

views:

126

answers:

1

I have a main screen that presents a modal view controller. When the modal controller is done it calls a method on the parent to dismiss the modal and then display a different modal view.

The problem is that after dismissing the modal view controller (the view does correctly disappear) the subsequent presentModelViewController doesn't do anything.

If I look at the modalViewController property on the root controller I can see that after doing the dismiss it is still set to the old modal controller. As noted above the view is no longer visible and also if I profile the application there are no instances of that view in memory.

Any ideas?

A: 

The problem was that the modal controllers viewDidDisappear had not been called before I was adding a new modal controller.

Once I ensured that I only tried to add a new modal after the original modal viewDidDisappear had been called it worked ok.

Ian1971