加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 百科 > 正文

The value of ESP was not properly saved across a function ca

发布时间:2020-12-14 21:07:12 所属栏目:百科 来源:网络整理
导读:1. The value of ESP was not properly saved across a function call 出现这种错误以前摸不着头脑,如坠五里雾。现在知道了,是函数接口定义格式不对 如我使用cocos2d::ui::Button时,定义点击函数: Button* button = Button::create(); button-addTouchEv

1. The value of ESP was not properly saved across a function call
出现这种错误以前摸不着头脑,如坠五里雾。现在知道了,是函数接口定义格式不对
如我使用cocos2d::ui::Button时,定义点击函数:
Button* button = Button::create();
button->addTouchEventListener(this,toucheventselector(HeroListLayer::menuPauseCallback));
然后这个menuPauseCallback声明为:
void HeroListLayer::menuAddHero(cocos2d::Ref *sender); //重点错误!
这样一来,调用和声明都是错的,特别是声明,是产生ESP was not properly save的根源,查查官方例程,原来声明是这样的:
void HeroListLayer::menuAddHero(cocos2d::Ref *sender,Widget::TouchEventType type);
调用是这样的:
button->addTouchEventListener(CC_CALLBACK_2(HeroListLayer::menuPauseCallback,this));

原来我声明的和官方定义的接口不符,当然要出错了,只是那个提示ESP was not properly save太诡秘,让人摸不着头脑 这样一改那个改死的ESP was not properly save就再也不会出现了

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读