我有一个奇怪的情况,如果我的应用程序进入后台并回到前台,动画会以某种方式累积并以超快的速度应用。例如,CCRotateBy 会赶上应用程序在后台运行的时间并快速旋转精灵。
我认为我的应用程序委托具有正确的应用程序状态处理..
- (void)applicationWillResignActive:(UIApplication *)application {
[[CCDirector sharedDirector] pause];
}
- (void)applicationDidBecomeActive:(UIApplication *)application {
[[CCDirector sharedDirector] resume];
[[OALAudioSession sharedInstance] forceEndInterruption];
}
- (void)applicationDidReceiveMemoryWarning:(UIApplication *)application {
[[CCDirector sharedDirector] purgeCachedData];
}
-(void) applicationDidEnterBackground:(UIApplication*)application {
[[CCDirector sharedDirector] stopAnimation];
}
-(void) applicationWillEnterForeground:(UIApplication*)application {
[[CCDirector sharedDirector] startAnimation];
[[OALAudioSession sharedInstance] forceEndInterruption];
}
- (void)applicationWillTerminate:(UIApplication *)application {
CCDirector *director = [CCDirector sharedDirector];
[[director view] removeFromSuperview];
[director end];
}
- (void)applicationSignificantTimeChange:(UIApplication *)application {
[[CCDirector sharedDirector] setNextDeltaTimeZero:YES];
}
是什么导致这种情况发生?