开发者

NSUserDefaults reset [duplicate]

开发者 https://www.devze.com 2023-03-13 08:15 出处:网络
This question already has answers here:开发者_StackOverflow社区 Closed 11 years ago. Possible Duplicate:
This question already has answers here: 开发者_StackOverflow社区 Closed 11 years ago.

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


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

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

精彩评论

暂无评论...
验证码 换一张
取 消