首选项窗格和10.7 中的 Plist 保存位置
我正在写一个首选项窗格 &这个 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 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您可能不应该显式写入
Library/Preferences
,而是使用NSUserDefaults
。如果这对您来说还不够,我相信~/Library/Application Support
是一个允许的选项。You should probably not explicitly write to
Library/Preferences
, but instead useNSUserDefaults
. If that's not enough for you, I believe~/Library/Application Support
is an allowable option.