I have this scheme:
I create a storyboard and subclass the UIViewController to
MyViewControllerand link it to correct class. Now I can have full access to this controller. But…
I want send a message to this object in application:didFinishLaunchingWithOptions: but I do not see how can I do it. Because I do not create the interface in code, I can’t link it.
How can I do this?
You can get a reference to your UIViewController by using the code below, which assumes it is the only UIViewController. The [[navigationController viewControllers] returns an array of the viewcontrollers, so you could grab the one you want.
I am curious if you could use the interface builder (Storyboard) and control drag from the view controller to the delegate .h file to create an IBOutlet…I do not have accesss to try that now, but will try when I get home….I could not get the drag method to work…