Q:

AppDelegate how to target navigation controller when root controller is tab bar controller

My root view controller is a tab controller with 3 tabs.
Tabs A and B are standard view controllers, C is a chain of navigation controller / view controllers. 
I would like to popToRootViewController (is this the right method in this case? or popToViewController ?) the C tab from AppDelegate. 
I have tried 
self.window.rootViewController.navigationController

But it gives nothing, probably because the navigation controller exists in only one tab.  

A:

If rootViewController is a UITabBarController then rootViewController.navigationController won't work since your tabbar does not have a navigation controller.
What you want to do is probably using popToRootViewController on the view controller which is the third tab of the TabbarController. (You have to be sure that this controller is an UINavigationController)
Something like that should work :
UITabBarController *tabbarController = (UITabBarController *) self.window.rootViewController;
UINavigationController *navController = tabbarController.viewControllers[2];
[navController popToRootViewController];

