比如:
调用如下:
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);
// 值传递也没问题
log(b);
}
想问下为什么会错,以及有没有什么好的解决方案