CCPointFromString崩溃:(在cocos2dx 2.0.4中

时间:2013-07-17 10:30:55

标签: android ios objective-c cocos2d-x

我正在进行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());

}

1 个答案:

答案 0 :(得分:1)

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());

}
相关问题