在cocos里面调用sdk页面时,如果在ios8.0上,切换sdk和cocos页面可能会引起opengl卡死,问题截图如下:
解决办法:
在RootViewController里面添加如下语句,用于在切换时停止cocos特效
- (void)viewWillDisappear:(BOOL)animated { [super viewWillDisappear:animated]; if ([[[UIDevice currentDevice] systemVersion] floatValue] >= 8.0 && [[[UIDevice currentDevice] systemVersion] floatValue] < 9.0) { cocos2d::Director::getInstance()->stopAnimation(); } } - (void)viewWillAppear:(BOOL)animated { [super viewWillAppear:animated]; if ([[[UIDevice currentDevice] systemVersion] floatValue] >= 8.0 && [[[UIDevice currentDevice] systemVersion] floatValue] < 9.0) { cocos2d::Director::getInstance()->startAnimation(); } }原文链接:https://www.f2er.com/cocos2dx/339371.html