Quantcast
Channel: Cocos中文社区 - 最新主题
Viewing all articles
Browse latest Browse all 89143

想用 CC_CALLBACK_1 进行指针传递,但好像不行,求解

$
0
0

@boubouplanet 写道:

比如:
调用如下:
int a = 100;
auto item = MenuItemImage::create("a.png", "b.png", CC_CALLBACK_1(A::method, this, &a, a));

method函数如下:
A::method(cocos2d::Ref* pSender, int *a, int b)
{
//有错误,值不对
log(*a);
//没问题
log(a);
}

帖子: 1

参与者: 1

阅读整个主题


Viewing all articles
Browse latest Browse all 89143

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>