문제

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