Hi all,
It seems that there are something wrong when I getting values from my plist file.
I get values with the following code.
CCDictionary *dict = CCFileUtils::dictionaryWithContentsOfFile(path);
CCDictionary *scene = (CCDictionary* )(dict -> objectForKey("scene"));
CCMutableArray *items = (CCMutableArray *)(scene -> objectForKey("still"));
if (items == NULL) return;
size_t count = items -> count();
for (int i = 0; i < count; ++i) {
CCDictionary *item = (CCDictionary *)(items -> getObjectAtIndex(i));
CCObject* nameObj = item -> objectForKey("name");
const char* name = (((CCString*) (nameObj)) -> toStdString()).c_str();
.....
}
the items in the for loop is come from a dictionary in the plist file(‘path’ is the path of the plist file).
The for loop works good for first a few values, but for a certain value such as i=3 in the sample, the var name is not the value in the plist. It’s something ramdom, such as “X(”, “P(”, “((” , or some thing like this.
So I try to skip i=3, but this happens when i=10.
I puts some value in the xml parser in the cocos2dx code. But the values are exactly right. So maybe, the something goes wrong when the parser returns the parsed results to the datastructs ?
It’s really strange…
Does someone have any ideas?
Thank you!