I have a strange problem that I'm hoping someone can give me a hint of where to look as two days of debugging hasn't enlightened me at all. Like most of you, I schedule a selector named step: which is the main animation loop. From time to time, I also pause and resume the director (when the user presses the pause button, etc.) In most cases, everything works fine. However, I have a scenario where I display a UIKit-based screen, resume the director, play the game and then return to the UIKit-based screen (this is a level selection screen). In fact this may not have anything to do with the problem (I'm not sure). All I can say is when I play the game from the main menu (which is a CocosNode layer), all is fine. When I play from the level selection screen, after returning to the level selection screen and selecting another level, none of the animation is scheduled-- my step: loop is not running.
I can clearly see that [[Director sharedDirector] resume] has been called and [self schedule: @selector(step:)] has been called in my game layer. The flow looks the same as normal gameplay, so this is why I mention the UIKit view in between. I've traced into CocosNode.m and see that schedule:selector executes the lines of code it normally does when everything is fine. There are no exceptions being thrown and nothing written to the console.
What could cause cocos2d to ignore the scheduling of a selector?
Thanks in advance,
Scott