I have small problem with removing a child Layer. I am not sure how to remove the layer correctly.
Here is my code sample
-(void)GoMoveFirst
{
//
//====HERE IS COMBOBOX START
CCMenuItemImage *lvl1 = newButton(@"retry1", 200, 590, self, @selector(onRetry));
CCMenuItemImage *lvl2 = newButton(@"retry1", 500, 590, self, @selector(onRetry)); //onHighScore:
CCMenuItemImage *lvl3 = newButton(@"retry1", 800, 590, self, @selector(onRetry));
CCMenu *menu = [CCMenu menuWithItems:lvl1, lvl2,lvl3, nil];
menu.position = ccp(0, 0);
[GameLayer addChild:menu z:103];
}
After I press one of this buttons, I need it to be removed. All stuff is going here:
-(void)onRetry
{
//
//HERE i need remove menu Child.
//
[m_sGo runAction:[CCSequence actions:actionMove, [CCCallFunc actionWithTarget:self selector:@selector(GoMoveSecond)], nil]];
}
One idea was try make it invisible, but I do not think this would be a suitable option.