Reputation: 33050
I am very curious. We really can't access it easily. I mean, I know it has, but not accessible.
Why?
Basically I want that rootViewController to be loaded before sending some events by accessing it's view. There is an postnotification that's set up on viewDidload.
Upvotes: 12
Views: 12473
Reputation: 318774
If you have more than one, then use:
UIViewController *root = navController.viewControllers[0];
where navController
is you UINavigationController
. This will work always.
Use UINavigationController topViewController
. This works if there is only one controller.
Upvotes: 18