0

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?

Stephan202
  • 59,965
  • 13
  • 127
  • 133
  • 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 Answers1

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