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"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
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 plistDictionary = CCFileUtils::dictionaryWithContentsOfFile;
CCArraytestitems = (CCArray*)plistDictionary->objectForKey(“testitems”);
CCLog(“COUNT: %d”, testitems->count());
Thanks in advance!