I know that I can use popToRootViewController if I have navigationController in my project but my whole project is based on presentViewControllers and there is a scenario where I am navigating to multiple levels. If there is only one level I can get back to root view controller by dismissing current view controller but I am not able to figure out how to navigate back to root view controller when I am down to more than one level. Could someone please advice me here?
I tried to use following code but my App crashes!
- (IBAction)mainMenuButtonPressed:(id)sender {
MyAppDelegate *delegate = (MyAppDelegate *)[[UIApplication sharedApplication] delegate];
[self presentModalViewController:delegate.window.rootViewController animated:YES];
}
Thanks.