I have a UIViewController subclass that accesses self.navigationController in viewDidLoad:. Depending on where it is in the view stack, I will either get the navigationController or I will get nil.
If my stack is "RootViewController -> MyViewController", I get a valid pointer.
If my stack is "RootViewController -> AnotherViewController -> MyViewController", I get nil.
In both cases, MyViewController is being pushed onto the stack with:
[self.navigationController pushViewController:self.myViewController
animated:YES];
This has me stuck, because I need to be able to push another ViewController on the stack above MyViewController, which works fine in the first case but obviously fails on the second.