[iOS]fixed #667: call AppDelegate::applicationDidEnterBackground() & AppDeleaget::applicationWillEnterForeground() when application enter background & enter foreground

This commit is contained in:
minggo 2011-08-10 10:24:06 +08:00
parent 5e5151b41e
commit d386116255
8 changed files with 15 additions and 15 deletions

View File

@ -87,14 +87,14 @@ static AppDelegate s_sharedApplication;
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. 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, called instead of applicationWillTerminate: when the user quits. If your application supports background execution, called instead of applicationWillTerminate: when the user quits.
*/ */
cocos2d::CCDirector::sharedDirector()->stopAnimation(); cocos2d::CCApplication::sharedApplication().applicationDidEnterBackground();
} }
- (void)applicationWillEnterForeground:(UIApplication *)application { - (void)applicationWillEnterForeground:(UIApplication *)application {
/* /*
Called as part of transition from the background to the inactive state: here you can undo many of the changes made on entering the background. Called as part of transition from the background to the inactive state: here you can undo many of the changes made on entering the background.
*/ */
cocos2d::CCDirector::sharedDirector()->startAnimation(); cocos2d::CCApplication::sharedApplication().applicationWillEnterForeground();
} }
- (void)applicationWillTerminate:(UIApplication *)application { - (void)applicationWillTerminate:(UIApplication *)application {

View File

@ -87,14 +87,14 @@ static AppDelegate s_sharedApplication;
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. 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, called instead of applicationWillTerminate: when the user quits. If your application supports background execution, called instead of applicationWillTerminate: when the user quits.
*/ */
cocos2d::CCDirector::sharedDirector()->stopAnimation(); cocos2d::CCApplication::sharedApplication().applicationDidEnterBackground();
} }
- (void)applicationWillEnterForeground:(UIApplication *)application { - (void)applicationWillEnterForeground:(UIApplication *)application {
/* /*
Called as part of transition from the background to the inactive state: here you can undo many of the changes made on entering the background. Called as part of transition from the background to the inactive state: here you can undo many of the changes made on entering the background.
*/ */
cocos2d::CCDirector::sharedDirector()->startAnimation(); cocos2d::CCApplication::sharedApplication().applicationWillEnterForeground();
} }
- (void)applicationWillTerminate:(UIApplication *)application { - (void)applicationWillTerminate:(UIApplication *)application {

View File

@ -1 +1 @@
a94593d95f2fff9766c611a35a6593a87d490698 a5ce034a4fc47a468b772dcde86d19007b7900b5

View File

@ -61,14 +61,14 @@ static AppDelegate s_sharedApplication;
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. 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, called instead of applicationWillTerminate: when the user quits. If your application supports background execution, called instead of applicationWillTerminate: when the user quits.
*/ */
cocos2d::CCDirector::sharedDirector()->stopAnimation(); cocos2d::CCApplication::sharedApplication().applicationDidEnterBackground();
} }
- (void)applicationWillEnterForeground:(UIApplication *)application { - (void)applicationWillEnterForeground:(UIApplication *)application {
/* /*
Called as part of transition from the background to the inactive state: here you can undo many of the changes made on entering the background. Called as part of transition from the background to the inactive state: here you can undo many of the changes made on entering the background.
*/ */
cocos2d::CCDirector::sharedDirector()->startAnimation(); cocos2d::CCApplication::sharedApplication().applicationWillEnterForeground();
} }
- (void)applicationWillTerminate:(UIApplication *)application { - (void)applicationWillTerminate:(UIApplication *)application {

View File

@ -62,14 +62,14 @@ static AppDelegate s_sharedApplication;
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. 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, called instead of applicationWillTerminate: when the user quits. If your application supports background execution, called instead of applicationWillTerminate: when the user quits.
*/ */
cocos2d::CCDirector::sharedDirector()->stopAnimation(); cocos2d::CCApplication::sharedApplication().applicationDidEnterBackground();
} }
- (void)applicationWillEnterForeground:(UIApplication *)application { - (void)applicationWillEnterForeground:(UIApplication *)application {
/* /*
Called as part of transition from the background to the inactive state: here you can undo many of the changes made on entering the background. Called as part of transition from the background to the inactive state: here you can undo many of the changes made on entering the background.
*/ */
cocos2d::CCDirector::sharedDirector()->startAnimation(); cocos2d::CCApplication::sharedApplication().applicationWillEnterForeground();
} }
- (void)applicationWillTerminate:(UIApplication *)application { - (void)applicationWillTerminate:(UIApplication *)application {

View File

@ -62,14 +62,14 @@ static AppDelegate s_sharedApplication;
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. 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, called instead of applicationWillTerminate: when the user quits. If your application supports background execution, called instead of applicationWillTerminate: when the user quits.
*/ */
cocos2d::CCDirector::sharedDirector()->stopAnimation(); cocos2d::CCApplication::sharedApplication().applicationDidEnterBackground();
} }
- (void)applicationWillEnterForeground:(UIApplication *)application { - (void)applicationWillEnterForeground:(UIApplication *)application {
/* /*
Called as part of transition from the background to the inactive state: here you can undo many of the changes made on entering the background. Called as part of transition from the background to the inactive state: here you can undo many of the changes made on entering the background.
*/ */
cocos2d::CCDirector::sharedDirector()->startAnimation(); cocos2d::CCApplication::sharedApplication().applicationWillEnterForeground();
} }

View File

@ -87,14 +87,14 @@ static AppDelegate s_sharedApplication;
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. 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, called instead of applicationWillTerminate: when the user quits. If your application supports background execution, called instead of applicationWillTerminate: when the user quits.
*/ */
cocos2d::CCDirector::sharedDirector()->stopAnimation(); cocos2d::CCApplication::sharedApplication().applicationDidEnterBackground();
} }
- (void)applicationWillEnterForeground:(UIApplication *)application { - (void)applicationWillEnterForeground:(UIApplication *)application {
/* /*
Called as part of transition from the background to the inactive state: here you can undo many of the changes made on entering the background. Called as part of transition from the background to the inactive state: here you can undo many of the changes made on entering the background.
*/ */
cocos2d::CCDirector::sharedDirector()->startAnimation(); cocos2d::CCApplication::sharedApplication().applicationWillEnterForeground();
} }
- (void)applicationWillTerminate:(UIApplication *)application { - (void)applicationWillTerminate:(UIApplication *)application {

View File

@ -75,14 +75,14 @@ static AppDelegate s_sharedApplication;
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. 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, called instead of applicationWillTerminate: when the user quits. If your application supports background execution, called instead of applicationWillTerminate: when the user quits.
*/ */
cocos2d::CCDirector::sharedDirector()->stopAnimation(); cocos2d::CCApplication::sharedApplication().applicationDidEnterBackground();
} }
- (void)applicationWillEnterForeground:(UIApplication *)application { - (void)applicationWillEnterForeground:(UIApplication *)application {
/* /*
Called as part of transition from the background to the inactive state: here you can undo many of the changes made on entering the background. Called as part of transition from the background to the inactive state: here you can undo many of the changes made on entering the background.
*/ */
cocos2d::CCDirector::sharedDirector()->startAnimation(); cocos2d::CCApplication::sharedApplication().applicationWillEnterForeground();
} }
- (void)applicationWillTerminate:(UIApplication *)application { - (void)applicationWillTerminate:(UIApplication *)application {