Howdy,
I have a UIViewController that contains a UITabBarController, which contains a UIViewController, e.g.:
UIViewController1 -> UITabBarController -> UIViewController2
I want to hook up a button in UIViewController2
that will call a method in UIViewController1
, but how do I access UIViewController1
from UIViewController2
? I know that calling self.parentViewController
from UIViewController2
gets me to the UITabBarController
, but where do I go from there?
I tried self.parentViewController.parentViewController
from UIViewController2, but got null
.
Any suggestions?