In Objective-C, what is the best way of getting a reference to the current UINavigationController? I would like to gain access to it from any class that may not have a reference to a UIController, delegate, or anything else.
Is there an existing way to get the current UINavigationController? Should I add something to my application delegate, and retrieve that?
As it turns out, you can get it, albeit with quite a bit of dot syntax, from any UIView/UIViewController descendant.
If you are using an object that descends from any other class, the same is true, except you must go through
UIApplicationOf course, both of these break MVC in a big way, and it is definitely recommended that any logic that must touch the “default navigation controller” be added to the root view controller.