I wrote a simple iPad app in Xcode 4. When I exit the app then go back into the app, it starts on the last page that I was at before exit. How do I have the app restart at a designated page at each restart?
Asked
Active
Viewed 163 times
0
-
do you mean exit like _terminate_ the applicaton, or you mean exit like the application _becomes inactive_? – holex Sep 12 '12 at 06:31
-
Terminate yes. I want the app to always start at the main page/main view. When I exit the app, pressing the home button, it takes me back to the last view – Arthur Harris Sep 18 '12 at 01:50
1 Answers
0
Look in your AppDelegate.m
file for the method applicationDidBecomeActive:
(below). This gets called whenever your app becomes active - either through being launched or through being returned from the background. This is the event that you would use to restore the state of you app - but the specifics would depend on how your app is setup.
- (void)applicationDidBecomeActive:(UIApplication *)application
{
// Restart any tasks that were paused (or not yet started) while
//the application was inactive. If the application was previously in the background,
//optionally refresh the user interface.
}

spring
- 18,009
- 15
- 80
- 160
-
Thanks for the response. Any examples so app will start from main screen/main view. Thanks – Arthur Harris Sep 18 '12 at 01:49
-
How your app sets itself up from a fresh launch - that is what you want to do to reset it. – spring Sep 18 '12 at 04:25