I want to save 1 integer using the UserDefault class.
right after i used setIntegerForKey i call flush to save the data.
But the data isnt saved (flush method also empty).
Also the data isnt placed into the ram, when i try getIntegerForKey it returns 0. (same game session)
i use the sharedUserDefault.
someone knows what im doin wrong?
auto sh = UserDefault::sharedUserDefault();
int val = sh->getIntegerForKey("xyz"); // returns 0 no matter what
if( score > val ){
sh->setIntegerForKey("xyz",score);
sh->flush(); // is empty, using cocos2dx 3.2rc0
}