OK... the way you're going about this is incorrect.
I can't be sure but this is how I would go about it:
Create a property in level 3 of the class LevelTwoViewController, and set like this: level3ViewController.number2ViewController = self;
then at level 3 tell level 4 that to set level4ViewController.number2ViewController = number2ViewController;
then at level 4 tell level 5 to set a property of it's own level5ViewController.number2ViewController = number2ViewController;
then in level 5 when the toolbar button is pressed, say:
[self.navigationController popToViewController:number2ViewController];
Does that make sense? Make each higher view have the second level as its property.
I dunno if that would work. If it doesn't, I'd use [[UIApplication sharedApplication] delegate] to drill down to find level 2 as a property of level 1. That would almost definitely work as its a singleton object (only references, doesn't create another object).
Then, alternately again, you could set it all up with view Controllers in a nib file and reference it via an IBOutlet.
Last edited by DevTeamOfOne; 11-05-2008 at 03:07 PM.
|