首选项窗格和10.7 中的 Plist 保存位置

发布于 2024-11-27 09:21:09 字数 249 浏览 2 评论 0原文

我正在写一个首选项窗格 &这个 prefpane 保存了一个包含设置和信息的 plist 文件。我曾经将其存储在 /Library/Preferences/ 文件夹中;这在 OS X 10.6 中运行良好,但现在我们切换到 10.7 和 10.7。苹果已撤销在 /Library/Preferences 文件夹中写入的权限(无需管理员密码),即 prefpane 无法在那里写入。是否有一个更好的位置可供所有系统访问,我可以在其中保存 prefpane 的 plist 文件。

I'm writing a preference pane & this prefpane saves a plist file with settings & I used to store this in the /Library/Preferences/ folder; This worked fine in OS X 10.6 but now we switched to 10.7 & apples has revoked the rights to write in the /Library/Preferences folder (without an administrator password) i.e. the prefpane can't write there. Is there a better location that is accessible by all the system where I can save my prefpane's plist file.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

明天过后 2024-12-04 09:21:09

您可能不应该显式写入Library/Preferences,而是使用NSUserDefaults。如果这对您来说还不够,我相信 ~/Library/Application Support 是一个允许的选项。

You should probably not explicitly write to Library/Preferences, but instead use NSUserDefaults. If that's not enough for you, I believe ~/Library/Application Support is an allowable option.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文