When using a NSDictionary that navigates to a PLIST I keep on getting an SIGABRT error,
**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'**
at this line, editLabelTextField.text = [alarm objectForKey:ROOT_KEY]; I don’t know why I am getting this. The alarm is a NSDictionary and it uses object for key to navigate to a key which I have declared like this, #define ROOT_KEY @"Root". I defined it in another file. The plist looks somewhat like this,
<?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>
[alarm objectForKey:@"Root"]returns anNSArray, which you’re trying to assign to a property which expects anNSString. (_isNaturallyRTLis an iOS-specific, private function ofNSString.)I assume you’re trying to get to the
label. Structurally, such an access would look like this (your variablealarmshould probably be calledalarmPlist):Replace the
0with a different index to access a different alarm.