0
我有一個plist中,在我的plist是一本字典,其值是字典,像這樣:的.plist如何讀字典在字典
<dict>
<key>Antenne Bayern</key>
<dict>
<key>shortcut</key>
<true/>
<key>url</key>
<string>http://www.antenne.de/webradio/antenne-aac.pls</string>
</dict>
<key>Technobase.fm</key>
<dict>
<key>url</key>
<string>http://listen.technobase.fm/tunein-aacplus-pls</string>
<key>shortcut</key>
<false/>
</dict>
</dict>
現在我想只讀URL中的關鍵「ANTENNE拜仁「如果在它的字典是‘快捷= 1’ 我不喜歡這樣寫道:
NSString *plistPath = [[NSBundle mainBundle] pathForResource:@"SenderDatabase" ofType:@"plist"];
NSDictionary *senderDictionary = [NSDictionary dictionaryWithContentsOfFile:plistPath];
NSDictionary *bli = [[NSDictionary dictionaryWithDictionary:senderDictionary] valueForKey:@"Antenne Bayern"];
NSLog(@"%@", bli);
NSString *check = [bli valueForKeyPath:@"shortcut"];
但我不想這樣做,在字典中的每個項目。如果「快捷方式= 1」,我只想返回「Antenne Bayern」這個名字。 你能幫我嗎?