How to save an application in the background in the background?

My application does not start from the current state, without closing my application, I am going to click on the background. I am just minimizing my application but not closing the application. If you run my application again, it will start from the beginning, like with a splash screen.

I want to run the application from the current state where I am minimizing my application.

My question is:

What I need to do in the application delegate class, here I work:

-(void) applicationDidEnterBackground:(UIApplication*)application {
    [[NSUserDefaults standardUserDefaults] setBool:NO forKey:@"SplashLoadCheck"];
    [[NSUserDefaults standardUserDefaults]synchronize];     
    if( [navController_ visibleViewController] == director_ )       
         [director_ stopAnimation]; 
}

-(void) applicationWillEnterForeground:(UIApplication*)application 
{   
     if( [navController_ visibleViewController] == director_ )      
        [director_ startAnimation]; 
}

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

    [[NSUserDefaults standardUserDefaults] setBool:NO forKey:@"SplashLoadCheck"];
    [[NSUserDefaults standardUserDefaults]synchronize];     CC_DIRECTOR_END(); 
}
+4
source share
2 answers

You can set the following flag plist.

"Application Does Not Run in Background" = NO.

This will allow the program to work in the background.

+1
source

, . . . , , . , . , , , , .

enter image description here

0

Source: https://habr.com/ru/post/1525159/


All Articles