I am developing an application which has about 8 views and use navigation controller to navigate through. The first view is a main menu.
What i want is (of each view) to pop to the main view if the user press the home button (App did enter background).
I know the AppDelegate methods applicationDidEnterBackground
and applicationWillEnterForeground
.
And i know the method popToRootViewControllerAnimated
called from the navigation controller.
I have tried to use popToRootViewControllerAnimated in applicationDidEnterBackground. Like:
[self.window.rootViewController.navigationController popToRootViewControllerAnimated:YES];
But this does not work.
Can you please let me know what is the best option for this job?
See Question&Answers more detail:os