I have a menu item which will call goToGameLayer when tapped. The goToGameLayer method simply does the following:
[[CCDirector sharedDirector] replaceScene:(CCScene*)[[GameLayer alloc] init]];
However, after replaceScene, the +(id)scene method in GameLayer is not called
+(id)scene{
NSLog(@"+(id)scene CALLED");
CCScene *scene = [CCScene node];
GameLayer *layer = [GameLayer node];
[scene addChild: layer];
return scene;
}
I find that dealloc method in the menuLayer is called after the init method in GameLayer, but I'm not sure whether that interrupts the dispose of current scene.
Thanks for any suggestion!