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