Objective C
wszystkie wartości:
NSLog(@"%@", [[[NSUserDefaults standardUserDefaults] dictionaryRepresentation] allValues]);
wszystkie klucze:
NSLog(@"%@", [[[NSUserDefaults standardUserDefaults] dictionaryRepresentation] allKeys]);
wszystkie klucze i wartości:
NSLog(@"%@", [[NSUserDefaults standardUserDefaults] dictionaryRepresentation]);
wykorzystujące do:
NSArray *keys = [[[NSUserDefaults standardUserDefaults] dictionaryRepresentation] allKeys];
for(NSString* key in keys){
// your code here
NSLog(@"value: %@ forKey: %@",[[NSUserDefaults standardUserDefaults] valueForKey:key],key);
}
Swift
wszystkie wartości:
print(UserDefaults.standard.dictionaryRepresentation().values)
wszystkie klucze:
print(UserDefaults.standard.dictionaryRepresentation().keys)
wszystkie klucze i wartości:
print(UserDefaults.standard.dictionaryRepresentation())
W domenie aplikacji lub domenie systemowej? – awiebe
http://stackoverflow.com/questions/1676938/easy-way-to-see-saved-nsuserdefaults – stosha
Dla Swift możesz użyć tego http://stackoverflow.com/a/27534573/1497737 – footyapps27