【发布时间】:2010-10-05 08:15:09
【问题描述】:
我有一个带有 settings.bundle 的 iPhone 应用程序,用于处理我的应用程序的各种设置。我可以在我的 root.plist 文件中设置默认值(使用 DefaultValue 属性),但这些仅在用户第一次打开设置应用程序时使用。有什么方法可以在您的应用程序安装时写出这些值?我知道我可以编写代码来检查我的应用程序的首次启动,然后将它们写出来,但是它们在两个不同的地方。
这里以我的 root.plist 中的一个条目为例:
<dict>
<key>Type</key>
<string>PSToggleSwitchSpecifier</string>
<key>Title</key>
<string>Open To Top Location</string>
<key>Key</key>
<string>open_top_location</string>
<key>DefaultValue</key>
<string>YES</string>
<key>TrueValue</key>
<string>YES</string>
<key>FalseValue</key>
<string>NO</string>
</dict>
最终结果应该是,如果我询问“open_to_top_location”,我会得到“是”,而不是在用户第一次打开“设置”应用程序之前它根本不存在。
有什么想法吗?
【问题讨论】:
标签: iphone cocoa-touch