Let's say you have an application in which you know for sure that there's always a UINavigationController
displayed, and that I need to display another view controller modally from outside this controller (for example : because I use the Command pattern and I don't want to give a reference to a view controller to it).
Is there a safe way to get the "root" navigation controller, and call its presentModalViewController:animated
method ?
I tried to use [UIApplication sharedApplication].keyWindow.rootViewController
but I figured out that it was nil during an alert.