我的应用程序今天通过 Xcode 运行时开始神秘地崩溃。我将问题跟踪到设置不可用,事实上,查看我的应用程序的设置应用程序,我看到:
转到 Xcode 中的 Settings.bundle,特别是 Root.plist,我收到以下错误消息:
因此,该文件已损坏。令人不安,但并不太担心。我得到了昨晚的文件副本(感谢 TimeMachine)。我在那个文件和我现在拥有的文件之间做了一个差异,我看不出有什么区别。我回去几天,直到找到一个不同的版本。不幸的是,那是我认真修改 root.plist 文件的时候,所以我在最新版本中找不到任何损坏的东西。
此外,该应用程序只会在以前从未安装过我的应用程序的新 iPhone 上崩溃。我的其他 iPhone 在通过 Xcode 运行同一个应用程序时不会崩溃,但都显示一个空的设置窗口,如上面的屏幕截图所示。我认为,尽管 root.plist 损坏,实际的 NSUSerDefaults 仍然存在于曾经有一个未损坏的 root.plist 的 iPhone 上,但在新 iPhone 上没有 NSUSerDefaults,这导致了我的一些坏事应用程序。
这是我的 plist 内容。你能发现任何损坏的东西吗?谢谢。(我已经检查了SO: Empty Settings Bundle in Xcode 4.2并没有帮助。)
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>PreferenceSpecifiers</key>
<array>
<dict>
<key>Type</key>
<string>PSGroupSpecifier</string>
</dict>
<dict>
<key>Type</key>
<string>PSMultiValueSpecifier</string>
<key>Title</key>
<string>Initial Magnification</string>
<key>Values</key>
<array>
<integer>1</integer>
<integer>2</integer>
<integer>3</integer>
</array>
<key>Titles</key>
<array>
<string>1x</string>
<string>2x</string>
<string>3x</string>
</array>
<key>Key</key>
<string>LuminInitialMagnificationKey</string>
<key>DefaultValue</key>
<integer>2</integer>
</dict>
<dict>
<key>Type</key>
<string>PSToggleSwitchSpecifier</string>
<key>Title</key>
<string>Large Lock Button</string>
<key>Key</key>
<string>LuminLockButtonEmphasis</string>
<key>DefaultValue</key>
<true/>
</dict>
<dict>
<key>Type</key>
<string>PSToggleSwitchSpecifier</string>
<key>Title</key>
<string>Picture-in-Picture Frame</string>
<key>Key</key>
<string>LuminOutlineEnabled</string>
<key>DefaultValue</key>
<true/>
</dict>
<dict>
<key>Type</key>
<string>PSGroupSpecifier</string>
<key>Title</key>
<string>Sound</string>
</dict>
<dict>
<key>DefaultValue</key>
<false/>
<key>Key</key>
<string>LuminFocusBeepKey</string>
<key>Title</key>
<string>Focus Beep</string>
<key>Type</key>
<string>PSToggleSwitchSpecifier</string>
</dict>
<dict>
<key>Type</key>
<string>PSGroupSpecifier</string>
<key>Title</key>
<string>Share Options</string>
</dict>
<dict>
<key>Type</key>
<string>PSChildPaneSpecifier</string>
<key>Title</key>
<string>Mail</string>
<key>File</key>
<string>EmailSettings</string>
</dict>
<dict>
<key>Type</key>
<string>PSChildPaneSpecifier</string>
<key>Title</key>
<string>Tweet</string>
<key>File</key>
<string>TweetSettings</string>
</dict>
<dict>
<key>Type</key>
<string>PSChildPaneSpecifier</string>
<key>Title</key>
<string>Facebook</string>
<key>File</key>
<string>FacebookSettings</string>
</dict>
<dict>
<key>Type</key>
<string>PSGroupSpecifier</string>
<key>Title</key>
<string>History</string>
<key>FooterText</key>
<string>Tagged images will not be deleted. Dropbox mirroring is queued until WiFi connectivity is available.</string>
</dict>
<dict>
<key>Type</key>
<string>PSMultiValueSpecifier</string>
<key>Title</key>
<string>Delay Before Saving</string>
<key>Values</key>
<array>
<string>1</string>
<string>3</string>
<string>5</string>
<string>7</string>
</array>
<key>DefaultValue</key>
<string>3</string>
<key>Titles</key>
<array>
<string>1 second</string>
<string>3 seconds</string>
<string>5 seconds</string>
<string>7 seconds</string>
</array>
<key>Key</key>
<string>LuminTimeToWaitBeforeHistoryKey</string>
</dict>
<dict>
<key>Type</key>
<string>PSTextFieldSpecifier</string>
<key>Title</key>
<string>Number of Images to Keep</string>
<key>Key</key>
<string>LuminNumberOfHistoryFilesKey</string>
<key>DefaultValue</key>
<string>100</string>
<key>KeyboardType</key>
<string>NumberPad</string>
</dict>
<dict>
<key>DefaultValue</key>
<false/>
<key>Key</key>
<string>LuminDropboxActive</string>
<key>Title</key>
<string>Mirror to Dropbox</string>
<key>Type</key>
<string>PSToggleSwitchSpecifier</string>
</dict>
<dict>
<key>Type</key>
<string>PSGroupSpecifier</string>
<key>FooterText</key>
<string>Lumin™ © 2011-2012 M. Zabetian & BitsOnTheGo.com. All rights reserved. Special Thanks to Tim Smith and AppliedDesign.tv.</string>
</dict>
<dict>
<key>Type</key>
<string>PSTitleValueSpecifier</string>
<key>DefaultValue</key>
<string>Unknown</string>
<key>Title</key>
<string>Version</string>
<key>Key</key>
<string>AppVersionStringKey</string>
</dict>
</array>
<key>StringsTable</key>
<string>Root</string>
</dict>
</plist>