user1078461
user1078461

Reputation: 35

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

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!

Upvotes: 0

Views: 389

Answers (1)

CodeSmile
CodeSmile

Reputation: 64477

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

Upvotes: 1

Related Questions