Having quite a bit of problems trying to figure out how to read in an array of strings from a plist. I checked that the CCDictionary returned was correct, but the array returned inside the CCDictionary was not what I expected, with a different array count and I’ve no idea what objects in it.
//setup animation frame names
linesmanIdle1 = CCMutableArray::arrayWithArray(NULL);
linesmanIdle1->retain();
const char *pszPath = CCFileUtils::fullPathFromRelativePath("LinesmanIdle1.plist");
CCDictionary *myDict = CCFileUtils::dictionaryWithContentsOfFile(pszPath);
CCArray *tempNameArray = (CCArray*)(myDict->objectForKey("Frames"));
CCObject *obj;
CCARRAY_FOREACH(tempNameArray, obj)
{
linesmanIdle1->addObject(
CCSpriteFrameCache::sharedSpriteFrameCache()->spriteFrameByName(((CCString*)obj)->toStdString().c_str()));
}
myDict->release();
Appreciate any advice on this matter and point out any silly mistakes I made.