当使用导航到 PLIST 的 NSDictionary 时,我不断收到 SIGABRT 错误,
**2011-09-26 18:31:01.740 AlarmAppiPhone[3126:10d03] -[__NSCFArray _isNaturallyRTL]: unrecognized selector sent to instance 0x5cb5090
2011-09-26 18:31:01.742 AlarmAppiPhone[3126:10d03] Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[__NSCFArray _isNaturallyRTL]: unrecognized selector sent to instance 0x5cb5090'**
在这条线上,editLabelTextField.text = [alarm objectForKey:ROOT_KEY];
我不知道为什么我会得到这个。警报是一个 NSDictionary,它使用对象作为键来导航到我这样声明的键,#define ROOT_KEY @"Root"
. 我在另一个文件中定义了它。plist 看起来有点像这样,
<?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>Root</key>
<array>
<dict>
<key>label</key>
<string>alarm1</string>
<key>time</key>
<date>2011-09-03T07:24:20Z</date>
</dict>
<dict>
<key>label</key>
<string>alarm2</string>
<key>time</key>
<string>2011-09-03T07:24:14Z</string>
</dict>
</array>
</dict>
</plist>