Access view controller from App delegate

145 views
Skip to first unread message

M. S. Hrishikesh

unread,
Mar 4, 2012, 10:45:40 AM3/4/12
to cocoa-...@googlegroups.com
Hi

I have a view controller MainView that is linked to a view in the storyboard. The storyboard also has a navigational controller and MainView is set as the first view of the navigation controller.

How do I set a property of MainView (essentially a pointer to its model) from my Application delegate (I plan to do this in applicationDidFinishLaunching)

Within the app delegate files I dont have a pointer to MainView

Thanks
Hrishi



mattn

unread,
Mar 5, 2012, 1:10:07 PM3/5/12
to cocoa-unbound
You are using a main storyboard, so you must wait until *after* the
main storyboard has loaded automatically. After that, the navigation
controller is your window's rootViewController and the MainView
controller is the first child of the navigation controller.
Reply all
Reply to author
Forward
0 new messages