Ravi
Ravi

Reputation: 1759

how to restart a application without going to recent worked page ,when we exit in ipad

I had installed my app on ipad(ios 4) , and i was navigating through the pages of my app.whenever i close the app and re open the app it goes back to the recent page which i was working on. But i want it to restart the app from first page,whenever i exit and reopen .As it is working on iphone(ios 3.1.3),Can any one suggest how to do that on ipad.

thanks in advance

Upvotes: 0

Views: 179

Answers (6)

Ved
Ved

Reputation: 612

Find your info.plist file in resources and add the key: "Application does not run in background" and set the value to 1.

Upvotes: 0

Deeps
Deeps

Reputation: 4577

I think you can do that easily. You need to set info.plist key "Application does not run in background" to YES and it will no longer to run in background. See Image below

Upvotes: 2

user784625
user784625

Reputation: 1938

Which methods are called when user presses home button and double presses it again to return

here you can find answer to event on clicking on home button interesting article

Upvotes: 0

Jamie
Jamie

Reputation: 5112

You need to set UIApplicationExitsOnSuspend to yes in your info.plist

Upvotes: 0

Alex Terente
Alex Terente

Reputation: 12036

On iOS 4 the app does not exit it goes to background. And when you tap on the icon the app resumes from where you left it.

If you want to reset something when it goes in background you need to implement custom code in appDelegate methods:

- (void)applicationDidEnterBackground:(UIApplication *)application
{
    /*
     Use this method to release shared resources, save user data, invalidate timers, and store enough application state information to restore your application to its current state in case it is terminated later. 
     If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits.
     */
}
- (void)applicationWillEnterForeground:(UIApplication *)application
{
    /*
     Called as part of the transition from the background to the inactive state; here you can undo many of the changes made on entering the background.
     */
}

Upvotes: 0

Praveen S
Praveen S

Reputation: 10393

When application enters background the delegate method appDidEnterBackground is called and when resumed the method willEnterForeGround will be called.

You can handle your application behaviour in these methods.

For more info you can refer to this link which explains the concepts beautifully.

Upvotes: 0

Related Questions