Quantcast
Channel: Developer Feed - Snippet
Viewing all articles
Browse latest Browse all 178

How to print values in NSUserDefaults to the NSLog?

$
0
0

Solution

NSUserDefaults is basically kind of hashmap(dictionary) that stores the keys and values.

In order to print all the keys do the follow:
NSLog(@"%@", [[[NSUserDefaults standardUserDefaults] dictionaryRepresentation] allKeys]);

In order to print both the keys & values do the follow:
NSLog(@"%@", [[NSUserDefaults standardUserDefaults] dictionaryRepresentation]);


Viewing all articles
Browse latest Browse all 178

Trending Articles