Hi, for my gameData I’m using plist, as its easier to me than xml.
I have successfully read the data but now I have to change values and I have no idea how can I do it.
One of my plist is a dictionary with some strings
std::string levelsFile = CCFileUtils::sharedFileUtils()->fullPathForFilename("gameData.plist"); CCDictionary*dictionary = CCDictionary::createWithContentsOfFileThreadSafe(levelsFile.c_str()); dictionary ->retain(); int characterSelected = dictionary->valueForKey("CharacterSelected")->intValue();
Well, now I want to change that key for other , like
int newCharacterSelected = 2; //something like this is what I want dictionary->setObject(newCharacterSelected, "CharacterSelected"); //But newCharacterSelected is NOT a CCObject
Hope someone can help me