NSDictionary* defaults = [[NSUserDefaults standardUserDefaults] dictionaryRepresentation
if([[NSUserDefaults standardUserDefaults] objectForKey:@"message"]==nil){
}
代码意思是判断NSUserDefaults的“message”key 在dictionaryRepresentation
设置“message”。
在加上句[[NSUserDefaults standardUserDefaults] synchronize];,这样这个设置就存到默认参数中了。
也见过别人把默认参数的设置写到applicationDidFinishLaun
- (void)applicationDidFinishLaun
{
}