views:

104

answers:

1

Hi all,

I am using following functions in my App delegate

- (void)applicationWillResignActive:(UIApplication *)application {
    NSLog(@"applicationWillResignActive");

}


- (void)applicationDidEnterBackground:(UIApplication *)application {

    NSLog(@"applicationDidEnterBackground");

}


- (void)applicationWillEnterForeground:(UIApplication *)application {
     NSLog(@"applicationWillEnterForeground");

}


- (void)applicationDidBecomeActive:(UIApplication *)application {

      NSLog(@"applicationDidBecomeActive");

}


- (void)applicationWillTerminate:(UIApplication *)application {
   NSLog(@"applicationWillTerminate");

}

All functions are working fine. But When i Delete the app from the Background by clicking "-" red button in the background tasks, and again open the app. no function has been called. What should i use instead of all the above functions..have any ideas?

What exactly i need is ..i need to save the application state when it has been deleted from the background using "-" red button and restore it when ever it opened.

+2  A: 

Hi,

You should save the state of the application when it enters background mode (-applicationDidEnterBackground). No delegate methods are called when a background app is terminated.

You should find a lot of useful informations about this in the iOS Application Programming Guide.

pjay_