Can CUserDefault::sharedUserDefault()->setxxxForKey() save data persistently?

Hi, all,

I am trying cocos2d-x to build an application accross Android and iOS. I need save data persistently, such like user’s account and password. Shall I use CCUserDefault::sharedUserDefault()->setxxxForKey()? I just found the information I saved is lost again when the device is restarted. Could anybody give me some guides? Thanks a lot in advance!

Best regards,

HouZhe

The data is saved in a xml file.
So it is persistent.

Hi, Minggo,

any way to check the XML file? I just cannot find the reason that the data I saved are lost :frowning:

Minggo Zhang wrote:

The data is saved in a xml file.
So it is persistent.

Yeap, you can print the result of CCUserDefault::getXMLFilePath();