iPhone cocos2d [super onExit]; causing crash when touch event occurs.

391 views Asked by At

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!

1

There are 1 answers

1
CodeSmile On BEST ANSWER

[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.