The NSUserDefaults object is typically used to save/restore your application related preferences, configuration data, etc – see Write and Read User Preferences for more information. In addition to application specifics, there is a system wide default list that is available to all applications, accessible using the class method standardUserDefaults in the NSUserDefaults object.
To get a list of the system wide settings:
NSDictionary* defaults = [[NSUserDefaults standardUserDefaults] dictionaryRepresentation]; NSLog(@"Defaults: %@", defaults);
Defaults: {
AppleICUForce24HourTime = 0;
AppleITunesStoreItemKinds = (
wemix,
podcast,
...
);
AppleKeyboards = (
"en_US@hw=US;sw=QWERTY",
"zh_Hant-HWR@sw=HWR",
"emoji@sw=Emoji"
);
AppleKeyboardsExpanded = 1;
AppleLanguages = (
en,
"zh-Hant",
fr,
de,
...
}
NSArray *array = [[NSUserDefaults standardUserDefaults] objectForKey:@"AppleKeyboards"]; NSLog(@"Keyboards: %@", array);
Keyboards: ( "en_US@hw=US;sw=QWERTY", "zh_Hant-HWR@sw=HWR", "emoji@sw=Emoji" )
没有评论:
发表评论