I have a Tab Bar application that shows several tabs. I case of notification I want user to be directed to a view controller with the ability to push "Back". When my app was only Navigation controller app, I used this code in my AppDelegate:
UIStoryboard *mainStoryboard = self.window.rootViewController.storyboard;
DetailViewController *detailViewController = (DetailViewController*)[mainStoryboard instantiateViewControllerWithIdentifier: @"detailViewController"];
[(UINavigationController*)self.window.rootViewController pushViewController:detailViewController animated:NO];
This code used to work fine until I converted my app to be Tab Bar. Seems like the "self.window.rootViewController" is not longer of type "UINavigationController" and therefore calling "pushViewController" generates an exception saying method doesn't exist. Any way to make this work on a Tab Bar application?
Thanks