gpt4 book ai didi

iphone - 应用程序设置更改: 2 synchronizes for StandardUserDefaults necessary?

转载 作者:行者123 更新时间:2023-12-03 21:18:15 27 4
gpt4 key购买 nike

我正在更改 iPhone 应用程序中的应用程序设置。

奇怪的是,我必须使用 StandardUserDefaults 执行 2 个同步命令,才能使我的更改反射(reflect)在应用设置中。

其次,当我在 iPhone 应用程序中更改“首选用户语言”时,我必须启动应用程序两次才能更改语言。

这是什么原因?

有没有办法转储StandardUserDefaults并查看存储在那里的所有设置?

感谢您的帮助!

最佳答案

Is there a way to dump the StandardUserDefaults and to see all the settings stored there?

是的,这很容易做到。

NSUserDefaults 存储在位于应用程序沙盒环境的 Library 文件夹内的 plist 文件中。

要在模拟器上检查这一点,请查看

~/Library/Application Support/iPhone Simulator/5.0/Applications/[hashed app identifier]/Library/Preferences/[application bundle identifier].plist

请注意,您必须替换括号中的值才能找到您的特定应用程序。另请注意,此路径适用于 iOS5.0 环境 - 对于其他环境,您必须将 5.0 替换为您正在使用的任何系统版本。

关于iphone - 应用程序设置更改: 2 synchronizes for StandardUserDefaults necessary?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/8248595/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com