1
我使用了cocos2d-2.0-RC2-X-2.0.1 @ 2012年6月29日写了这样CCArray “访问冲突读取位置”
.H
...
protected:
CCArray *array;
...
的.cpp
...
bool HelloWorld::init()
{
...
array= CCArray::create(2);
array->addObject(obj1);
array->addObject(obj2);
...
}
void HelloWorld::ccTouchesBegan(CCSet* touches, CCEvent* event)
{
CCLog("%i", array->count());
}
...
并得到这个: 0xC0000005:访问冲突读取位置“0xfeeefeee”。
在
CCArray.cpp
unsigned int CCArray::count()
{
return data->num;
}
请帮助。
像这个0xfeeefeee这样的幻数通常指向一个解除分配的对象或超出范围的问题。例如,malloc guard和其他调试设置使用这种模式来检测缓冲区覆盖。 – LearnCocos2D 2012-07-12 19:45:48