//字典存入本地
NSUserDefaults *userdef = [NSUserDefaults standardUserDefaults];
[userdef setObject:xxx forKey:xxx];
[userdef synchronize]; //每次更新数据
//拿到所存内容
NSUserDefaults *userdf = [NSUserDefaults standardUserDefaults];
[userdf objectForKey:_model.uid]
//清除
NSString*appDomain = [[NSBundle mainBundle] bundleIdentifier];
[[NSUserDefaults standardUserDefaults] removePersistentDomainForName:appDomain];
网友评论