I have a published simple game in App Store using Cocos2D framework.
Now I’m trying to export it to Android, and the best option I have found is obviously Cocos2D-X. I have been implementing some screens successfully, but now I cannot continue and don’t know what is the problem.
I’m trying to read a plist which contains the game data. I have created the following plist which is a simple implementation of the real one:
@<?xml version="1.0" encoding="UTF-8"?> testitems name Test1 height 480 name Test2 height 500 name Test3 height 420 name Test4 height 360 @
Now if I try the following, I expect in LogCat “Count: 4”, but the fact is I get a random number in each execution… What I’m doing wrong??
CCDictionary<std::string, CCObject*> plistDictionary = CCFileUtils::dictionaryWithContentsOfFile;
CCArraytestitems = (CCArray*)plistDictionary->objectForKey(“testitems”);
CCLog(“COUNT: %d”, testitems->count());
Thanks in advance!