CCUserDefault : fast way to use it?

CCUserDefault : fast way to use it?
0.0 0


According to the source code, it looks like CCUserDefault open/close the XML file for every single member we need to save/load. I wanted to use this to store the save game data but this behavior would probably slows everything down. Is there a way to use CCUserDefault to write a lot of data at once (in memory) and only write it to disk after? Should I use something else instead of CCUserDefault?
I guess it’s quite easy to modify, but I wan’t to make sure I’m not missing something, here.



Modifying CCUserDefault is the best way. Save key-value to a map, then add CCUserDefault::saveAll() method to write them into a file.