Is there a way to get all values in NSUserDefaults? [duplicate]
问题 This question already has answers here : Easy way to see saved NSUserDefaults? (22 answers) Closed 6 years ago . I would like to print all values I saved via NSUserDefaults without supplying a specific Key. Something like printing all values in an array using for loop. Is there a way to do so? 回答1: Objective C all values: NSLog(@"%@", [[[NSUserDefaults standardUserDefaults] dictionaryRepresentation] allValues]); all keys: NSLog(@"%@", [[[NSUserDefaults standardUserDefaults]