Trying to build a mobile game. I am using Windows PC for developing. But when I save data though UserDefault it is not saving. Even the snippet below does not work.
const char* key = "theKey";
UserDefault::getInstance()->setIntegerForKey(key, 1);
UserDefault::getInstance()->flush();
int what = UserDefault::getInstance()->getIntegerForKey(key);
UserDefault::getInstance()->flush();
what = UserDefault::getInstance()->getIntegerForKey(key);
This always returns 0.
There is no other language on c:\user\MyName.
Any suggestion?
Thanks.