UserDefault 저장소



UserDefault::getInstance() -> setBoolForKey(key , value) 

UserDefault::getInstance() -> setDoubleForKey(key , value)

UserDefault::getInstance() -> setFloatForKey(key , value)

UserDefault::getInstance() -> setIntegerForKey(key , value)

UserDefault::getInstance() -> setStringForKey(key , value)


UserDefault::getInstance() -> getBoolForKey(key)

UserDefault::getInstance() -> getDoubleForKey(key)

UserDefault::getInstance() -> getFloatForKey(key)

UserDefault::getInstance() -> getIntegerForKey(key)

UserDefault::getInstance() -> getStringForKey(key)




저장소에 저장

1
2
3
int highscore = UserDefault::getInstance()->getIntegerForKey("HIGHSCORE")+1;
UserDefault::getInstance()->setIntegerForKey("HIGHSCORE", highscore);
UserDefault::getInstance()->flush();
cs


저장소에서 불러오기

1
int highscore = UserDefault::getInstance()->getIntegerForKey("HIGHSCORE"0);
cs


+ Recent posts