Any known issues with cocos2d-1.0.1-x-0.9.2 and iPhone 4S running iOS 5.1? I’m having reports of peoples CCUserDefaults getting reset who have this configuration. I can’t figure out the problem, I don’t have it but I’m using an iPhone 4, not 4S
0.9.2 is very old. My suggestion is upgrade to 0.12.0 if you are not hurry on supporting iPad retina.
About your question, please tell me more details how can I reproduce this bug on iPhone.
It appears that CCUserDefaults wasn’t getting saved because I was never calling flush(). The settings used to get saved when I was not calling it but all of a sudden stopped working until I added flush commands. Did something change in cocos2d-x that now requires a flush call to write the xml data to disk? I’m not sure why it was working before without calling flush.
Also, for some people CCUserDefaults does not work on their device at all! I had a user who said none of their settings were getting saved, however I have several users whos settings DO get saved. I made the person having trouble a special build where I replaced all CCUserDefault calls with NSUserDefault calls and it works for them. It seems there is a bug in CCUserDefaults that makes it not work for only some people. I can’t figure out why, I dont have their devices to debug, I just know it doesn’t work. I could send you my code if you need some help figuring out why.
I’ve also updated to cocos2d-1.0.1-x-0.13.0-beta and have the same CCUserDefault bug for a small percentage of my users.
In previous version, CCUserDefault write to file every time you invoke a function of it.
Now, it will not save the result until you invoke flush or when App exit.