阅读另一个应用程序的首选项 plist,或分享一些首选项?
我想分享两个应用程序(游戏及其编辑器)之间的偏好。我怎样才能最好地完成这个任务?我认为游戏可以明确地从编辑器的首选项 plist 中读取,但我不确定实现这一点的最干净的方法是什么。
I'd like to share a preference between two apps (a game and its editor). How can I best accomplish this? I thought the game could explicitly read from the editor's preferences plist, but I'm not sure what the cleanest way to achieve this is.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
NSUserDefaults
维护要搜索的域列表。默认情况下,它只查看应用程序的首选项文件,但您可以让它搜索其他位置。您可以执行以下操作:
在应用程序之间共享首选项。
NSUserDefaults
maintains a list of domains to search. By default it just looks at your application's preferences file, but you can have it search other places.You can do something like this:
To share preferences between apps.
只需下拉至 CFPreferences API 即可获取专家参数。 NSUserDefaults 的首选项理念适用于应用程序,但 CFPreferences 允许您为所需的多应用程序首选项类型定义主机、套件等。
Just drop down to CFPreferences APIs for the expert parameters.
NSUserDefaults
' idea of preferences is for an app, but CFPreferences allow you to defines hosts, suites, and so on for the type of multi-app preferences you want.