I recently started seeing this error in my Cocos 2d iPhone application running on iOS 4.1:
sgx error (background gpu access not permitted):
Program received signal: “SIGABRT”.
After searching around, I found this thread on the cocos2d forum.
I modified my code in the ApplicationDelegate to look like:
- (void)applicationDidEnterBackground:(UIApplication *)application
{
[[CCDirector sharedDirector] stopAnimation];
}
- (void)applicationWillEnterForeground:(UIApplication *)application
{
[[CCDirector sharedDirector] startAnimation];
}
- (void)applicationWillResignActive:(UIApplication *)application
{
[[CCDirector sharedDirector] pause];
}
- (void)applicationDidBecomeActive:(UIApplication *)application
{
[[CCDirector sharedDirector] resume];
}
阅读(1325) | 评论(0) | 转发(0) |