存入本地
NSString *string = [NSString stringWithString @“NeiGou"];
NSUserDefaults *ud = [NSUserDefaults standardUserDefaults];
[ud setObject:string forKey:@"myKey”];
取数据
NSString *value;
value = [ud objectForKey:"myKey"];
存入本地
NSString *string = [NSString stringWithString @“NeiGou"];
NSUserDefaults *ud = [NSUserDefaults standardUserDefaults];
[ud setObject:string forKey:@"myKey”];
取数据
NSString *value;
value = [ud objectForKey:"myKey"];
本文标题:NSUserDefaults
本文链接:https://www.haomeiwen.com/subject/klfbqttx.html
网友评论