I created button class there is 3 function in class as following;
void MyButtonClass::Create(const std::string &buttonImage, cocos2d::Layer *layer)
{
myButton = ui::Button::create(buttonImage, buttonImage);
layer->addChild(myButton, 100);
}
void MyButtonClass::SetPosition(float xPosition, float yPosition)
{
myButton->cocos2d::Node::setPosition(xPosition, yPosition);
}
void MyButtonClass::SetTouchListener(Ref *sender, SEL_TouchEvent *selector)
{
myButton->addTouchEventListener(sender, selector);//There is problem, How can I set listener from other class.
}