簡體   English   中英

訪問 NSDictionary 的 NSArray 值

[英]Accessing the NSArray values of the NSDictionary

我正在使用 MWFeedParser 將 url 帶入表視圖。 我已閱讀文檔並發現我可以訪問 item.enclosures(NSDictionary 的 NSArray,鍵為 url,類型和長度)。 我想從陣列中訪問 URL。 我需要幫助弄清楚如何訪問 NSDictionary 的 NSArray 值,這就是我目前所擁有的。

if (indexPath.section == SectionHeader && indexPath.row == SectionHeaderEnclosure) {
    if (item.enclosures) {
        for (NSDictionary *url in item.enclosures){
            //How to access here;
        }
    }
}
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);  
        }  
    }  
}  

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM