NSUserDefaults reset

Rachit picture Rachit · Jun 15, 2011 · Viewed 17.5k times · Source

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

Answer

audience picture audience · Jun 15, 2011

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

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