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
In the simulator top menu: Simulator -> Reset Content and Settings... Show activity on this post. You can use removePersistentDomainForName method available with NSUserDefaults Class.
The NSUserDefaults class provides a programmatic interface for interacting with the defaults system. The defaults system allows an app to customize its behavior to match a user's preferences. For example, you can allow users to specify their preferred units of measurement or media playback speed.
Here is how to do it without looping over all values and removing them.
NSString *domainName = [[NSBundle mainBundle] bundleIdentifier]; [[NSUserDefaults standardUserDefaults] removePersistentDomainForName:domainName];
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With