它是一款带有 cocos2d 2.1 beta 的游戏。
我使用了按下按钮时出现的单独的 viewController。当我在这两者之间快速切换时,有时游戏会挂起……不会崩溃……fps标签有效。像stopAnimation这样的东西..
我的代码有什么问题?如何避免挂起?只有在快速切换时。
-(void)showNativeView
{
UIViewController *controller = [[UIViewController alloc] init];
AppController *app = (AppController*) [[UIApplication sharedApplication] delegate];
[[app navController] presentModalViewController:controller animated:NO];
[UIView animateWithDuration:1.0
animations:^{controller.view.alpha = 1.0;}];
[controller release];
}
-(void)gotoGameAgain
{
AppController *app = (AppController*) [[UIApplication sharedApplication] delegate];
[app navController].modalTransitionStyle = UIModalTransitionStyleCrossDissolve;
[[app navController] dismissModalViewControllerAnimated:YES];
}