iPhone cocos2d [super onExit]; causing crash when touch event occurs.
-
21-03-2021 - |
Frage
Please help!
When I use:
-(void) onExit {
[super onExit];
}
my app crashes if the screen is touched in the next scene after onExit is called. The error points to:
-(void) touches:(NSSet*)touches withEvent:(UIEvent*)event withTouchType:(unsigned int)idx
within "CCTouchDispatcher.m". However, when I remove the [super onExit]; line, it doesn't crash.
Any advice is appreciated! Thanks!
Lösung
[super onExit] is necessary, otherwise touch handling is disabled - which explains why it won't crash if you remove it.
You have a memory issue, most likely some object has been released without being removed from CCTouchDispatcher. NSZombieEnabled is your friend.
Lizenziert unter: CC-BY-SA mit Zuschreibung
Nicht verbunden mit StackOverflow