在 OS X 应用程序中以编程方式清除用户默认值
我正在开发我的应用程序的测试版本,我需要确保在首次启动最终版本时,测试人员将使用完全清晰的用户默认设置启动应用程序...(我不能更改捆绑包 ID)。
1) 有没有办法以编程方式清除用户默认值?
2) 将此应用程序沙箱化以提交 App Store 对我有帮助吗?
I'm working at the beta version of my App and i need to be sure that at first launch of the final release users that have been beta tester will start the application with a completely clear user default set... (i can't change the Bundle ID).
1) Is there a way to clear user defaults programmatically ?
2) Will sandboxing this App for the App Store submission helps me ?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
您可以像这样删除它:
要在第一次启动时运行它,我只需设置一个 BOOL 标志。一种方法如下:
You can remove it like this:
To run it on your first launch, I would just set a BOOL flag. One way to do it is as follows:
+[NSUserDefaults重置标准用户默认值]?如果您已正确注册默认值,则此行将重置为您提供的已注册默认值。
What's wrong with +[NSUserDefaults resetStandardUserDefaults]? If you've registered your defaults properly, this single line will reset to the registered defaults you provided.