This problem started happening when I subclassed CCSprite (Entity) to recieve touch input. When I'm going away from the main scene by pushing to another, I make all Entities remove their delegation from the shared CCTouchDispatcher (ie onExit()). And then reactivate when the main scene returns (onEnterTransistionFinished()).

Half of the times this works fine. However, the other times this happens:

cocos2d: deallocing <CCScheduler: 0x2323a0>

Which I find rather strange. Is it even plausible that the Touch Delegates are the cause of the problem? Or is it perhaps memory-related?

有帮助吗?

解决方案 2

If I remember correctly the problem originated from trying to register/unregister the same Entity to/from the TouchDispatcher twice (ie it didn't have time to unregister/register before I tried registering/unregistering it again).

I solved it by adding a little BOOL _didRegisterWithTouchDispatcher to avoid doing something like that.

其他提示

Are you perhaps issuing [[CCScheduler sharedScheduler] release]? If so, don't do that.

The CCScheduler is a singleton. It should never deallocate by itself.

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top