NSUserDefaults reset [duplicate]

2019-01-22 18:49发布

问题:

Possible Duplicate:
How can I reset the NSUserDefaults data in the iPhone simulator?

Can we reset NSUserDefaults for all the keys at the same time? Right now I reset for individual keys. So if there is a way to do that in a single go please tell me.

Thanks

回答1:

Here is how to do it without looping over all values and removing them.

NSString *domainName = [[NSBundle mainBundle] bundleIdentifier];
[[NSUserDefaults standardUserDefaults] removePersistentDomainForName:domainName];