0

In my game when a user loses the game over screen just appears as a popup with a faded background, while the game is still running. I've placed a back button which returns the user to the MenuScene and a replay which replays the GameScene. when I run the code after setting an exception breakpoint, I got an error pointing to the CCMenuItem.m class in the method

-(id) initWithNormalImage: (NSString*) normalI selectedImage:(NSString*)selectedI disabledImage: (NSString*) disabledI target:(id)target selector:(SEL)selector;

on the line:

[t performSelector:selector withObject:sender];

and the log printed:

-[GameOverLayer backToMenuScene:]: unrecognized selector sent to instance 0x151b9c20

How can I solve this issue?

UPDATE Also the exception break point pointed to the line

_block(self);

In the CCMenuItem.m class in the activate method.

IMustCode
  • 109
  • 8
  • @LearnCocos2D: Thanks, I managed to solve the issue, I forgot there was no argument for my selector's method. But another one is preventing my game from going to the main menu. When I press the back button to return to main menu I get `EXC_BAD_ACCESS` pointing to my sprite's class `dealloc` method for releasing an animation sequence `[sequenceOfActions release];` and another pointing to the `dealloc` method in the `HelloworldLayer.mm` releasing an instance of the sprite i.e. `[sprite release];`. I am not too show how to get out of this one. – IMustCode Oct 11 '13 at 19:57
  • in this day and age you should really be using ARC. You're over-releasing an object, possibly an autoreleased one – CodeSmile Oct 11 '13 at 20:05

0 Answers0