//保存name为"ken",hp为123的数据
UserDefault::getInstance()->setStringForKey("name","ken");
UserDefault::getInstance()->setIntegerForKey("hp",123);
UserDefault::getInstance()->flush();
int hp =UserDefault::getInstance()->getIntegerForKey("hp");
CCLOG("hp= %d",hp);
//可作为本地存储的方法(不过玩家可以直接改文件数据来作弊)