在 cocos2d-x 中,下面这段代码应该会在延迟后运行回调函数。我需要做什么来修复错误?
bool LoadingLevelScreen::initialise() {
// set up the time delay
CCDelayTime *delayAction = CCDelayTime::actionWithDuration(0.5f);
// perform the selector call
CCCallFunc *callSelectorAction = CCCallFunc::actionWithTarget(
this, callfunc_selector( LoadingLevelScreen::menuCallbackStart ) );
// run the action
this->runAction( CCSequence::actions(
delayAction, callSelectorAction, NULL ) );
}
void LoadingLevelScreen::menuCallbackStart(CCObject * pSender)
{
}
编译器错误:
error C2440: 'type cast' :
cannot convert from 'void (__thiscall LoadingLevelScreen::* )(cocos2d::CCObject *)'
to 'cocos2d::SEL_CallFunc'
Pointers to members have different representations; cannot cast between them