What I'm trying to do:
- Display a modal view, where I get some user input
- Display another one and get more input
- Do some stuff with the input from 1. and 2.
Problem is: presentModalViewController:animated: is non blocking. That means I can't just do the steps 1.-3. sequentially.
How I tried to solve it:
ViewController0 builds ViewController1 and gives him a reference to itself, then does presentModalViewController:animated:. ViewController1 will gather user input, then call a method on ViewController0 (it has the reference). That method will build ViewController2 and do the same as with the first one. ViewController2 will also call a method on ViewController0 (might even be the same one). Now ViewController0 has all the data (or should) and can proceed to step 3.
Problem with this approach:
- It looks like a horrible hack (there has to be a better way to do it).
- It doesn't work. :-) The problem is when ViewController0 tries to display ViewController2. That one won't even get displayed. My assumption (I'm new to iPhone programming, but I did some Windows programming before) is that this operation is not done instantly, but posted somewhere for further processing (similar to the WIN32 msg queue), and so it will somehow conflict with the operation of removing ViewController1!
So, any idea how I can either solve this problem in a simpler way or make it work this way?