请教大侠:
cocos v 3.7.1 场景再现:
bool HelloWorld::init()
{
......
helpSprite = Sprite::create("help0.png"); //helpSprite 在class的头文件声明
.........
EventListenerTouchOneByOne* listenerTouch = EventListenerTouchOneByOne::create();
listenerTouch->onTouchBegan = CC_CALLBACK_2(HelloWorld::onTouchBegan, this);
_eventDispatcher->addEventListenerWithSceneGraphPriority(listenerTouch, this);
......
}
bool HelloWorld::onTouchBegan(Touch* touch, Event* event)
{
static int clickCount = 1;
Size visableSize = Director::getInstance()->getVisibleSize();
helpSprite->setPosition(visableSize.width / 2, visableSize.height / 2); // 0xC0000005: 读取位置 0xFEEEFF36 时发生访问冲突。调试跟踪不进去,郁闷
this->addChild(helpSprite);
return false;
}
```
难道这是cocos2d-x的机制造成的吗?不能再这样用还是我使用的问题? 请大侠们看看,多谢啦