I tried to use CCMenu and addChild to add CCMenuItem, when I call CCMenu getChildByTag. I got message says: “getActionByTag: Target not found”.
Any idea what is wrong.
The sample code is:
CCMenuItemImage speaker = CCMenuItemImage::itemFromNormalImage);
speaker~~>setTag;
CCMenu menu = CCMenu::menuWithItem;
CCMenuItemImageitem = menu~~>getChildByTag;***** here does not work.
CCMenu::menuWithItem(speaker) doesn’t add speaker as a child of CCMenu, it justs add speaker to its array.
It meas that speaker is not a child of menu.
So you can not use getChildByTag to find it.