the following statement is returning an nil…
NSArray *viewControllersInNavStack = [[self navigationController] viewControllers];
and this statement is being called in a view controller that’s about four levels deep in the navigation stack, so I don’t understand how or why it would ever return nil. Your thoughts?
Thanks so much for your wisdom!
I found the problem. This statement was being called in response to an ApplicationWillResignActive notification. Well, one of the other view controllers higher up the stack was also listening for the same notification and its handler popped that view controller off the stack, along with all the other view controller deeper down the stack, including the one executed the code above. Therefor, by the time the code was executed, its view controller was no longer on the stack.