CCUserDefault - remove/reset the xml file

Hello

I want to delete the data that I put on the UserDefault but I didn’t find any method that does this.
Can anyone help me with this ?

Thanks!
Adrian

CCUserDefault is used for saving your configuration file. I don’t think it needs a remove method. You can just delete the file if you want to reset it.

Is there a method or a helper function to delete this file ?

You can add ‘reset’ method for CCUserDefault as follows:

void CCUserDefault::reset()
{
    string strFilePath = CCFileUtils::getWriteablePath() + XML_FILE_NAME;
    remove(strFilePath.c_str());
}

Very nice.
Thanks a lot!

@dumganhar

void CCUserDefault::reset()
{
    string strFilePath = CCFileUtils::sharedFileUtils()->getWritablePath() + XML_FILE_NAME;
    remove(strFilePath.c_str());
}