我正在执行CCPointFromString转换,但是每当我尝试输入时,代码都会崩溃,这是代码,我在做什么错?
CCPoint *temp = new CCPoint(oldLocationCon.x, oldLocationCon.y);
pointInsert->addObject(temp);
for(int i=0; i<pointInsert->count(); i++){
CCString point = (CCString*)pointInsert->objectAtIndex(i);
CCPoint savePoint= CCPointFromString(point->getCString());
}
最佳答案
CCArray * pointInsert = CCArray::create();
CCPoint * temp = new CCPoint(0, 0);
pointInsert->addObject(temp);
for(int i = 0; i < pointInsert->count(); i++){
CCString * point = static_cast<CCString*>(pointInsert->objectAtIndex(i));
CCPoint savePoint= CCPointFromString(point->getCString());
}
关于android - CCPointFromString崩溃:(在cocos2dx 2.0.4中,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/17697395/