2011-06-10 62 views
1

我正在使用MWFeedParser將url帶入表視圖。我已閱讀文檔,並發現我可以訪問item.enclosures(NSArray的NSDictionary與鍵的URL,類型和長度)。我想從數組中訪問URL。我需要幫助搞清楚如何訪問NSDictionary的NSArray值,這是我迄今爲止。訪問NSDictionary的NSArray值

if (indexPath.section == SectionHeader && indexPath.row == SectionHeaderEnclosure) { 
    if (item.enclosures) { 
     for (NSDictionary *url in item.enclosures){ 
      //How to access here; 
     } 
    } 
} 

回答

1
if (indexPath.section == SectionHeader && indexPath.row == SectionHeaderEnclosure) { 
    if (item.enclosures) { 
     for (NSDictionary *dict in item.enclosures){ 
      NSString *url = [dict objectForKey:@"url"]; 
      NSLog(@" url is : %@",url); 
     } 
    } 
} 
+0

真棒!謝謝! – 2011-06-10 17:52:14

+0

@CKallemeres歡迎:) – Tatvamasi 2011-06-10 17:53:29