Jumping to a point in a navigation stack
Posted on 2011-03-20
Just after a bit of advice really and a push in the right direction.
I have a modal view with a navigation controller containing 3 levels (views):
1. My Active Jobs (pulls a list of the users active jobs from the server and displays as a table, select a job and view 2 is passed the jobID and displayed).
2. Job Details (pulls the job details and a list of its updates based on the jobID from the server, select an update and view 3 is passed the updateID and displayed).
3. Update Details (pulls the details of the update based on the updateID from the server and any photos attached to that update, select a photo and it displays full screen.
So I have a seperate modal view in a different part of the app which displays the latest updates to the jobs. This includes new jobs assigned to the user and new updates for active jobs.
What I would like to do is link directly to the relevant view in the navigation controller when an item is selected in the latest updates modal window.
So my thoughts are to call the the Active jobs modal view when a latest update is selected and pass the relevant ID(s), initialise the combination of views needed in the stack pass the ID(s) to the views then initialise the navigation controller with the setViewControllers:animated: method.
Is this the best way to do it, or is there a better way?
Any help or suggestions would be greatly appreciated.