2011-06-10 74 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