I have a problem with a cocos2d 3.0 project for iPhone, where basically the animation stops when the app is sent to the background and does not start again when re-launching the app.
The whole Xcode project was copied exactly from another of mine which does not exhibit this bug, and the only major thing I've done is integrating a few ad networks (Chartboost and PlayHaven) - but I have commented out all of the ad code to test if that is the cause and that had no effect.
The working (older) project runs at 60 FPS (observed through the console entries that state cocos2d: animation started with frame interval: 60.00
) and drops to 4 FPS when being sent to the background (standard cocos2d behaviour), and then restarts at 60 FPS when launched again. The project I'm having a problem with relaunches at 4 FPS, but even this is wrong - there is just no animation at all.
I have tried adding the following code in applicationDidBecomeActive:
[[CCDirector sharedDirector] setAnimationInterval:1.0/60];
[[CCDirector sharedDirector] startAnimation];
And this makes the console log when re-launching say 60 FPS rather than 4, but it still has no actual effect on animation - it's still just stopped.