2011-04-11 72 views
1

我使用MWFeedParser從YouTube原子飼料從這裏讀到:hereMWFeedParser標籤(媒體:縮略圖)

XML代碼:

<media:thumbnail url='http://i.ytimg.com/vi/7_1PfqGVSg0/0.jpg' height='240' width='320' time='00:01:34.500'/> 

我怎麼能得到媒體的網址:縮略圖? 我試圖從這個在MWFeedParser.m 改變:

else if ([currentPath isEqualToString:@"/feed/entry/link"]) { [self processAtomLink:currentElementAttributes andAddToMWObject:item]; processed = YES; } 

這樣:

else if ([currentPath isEqualToString:@"/feed/entry/media:thumbnail"]) { [self processAtomLink:currentElementAttributes andAddToMWObject:item]; processed = YES; } 

,但它不工作:(

回答

3

在部分情況下FeedTypeAtom添加以下代碼:

else if ([currentPath isEqualToString:@"/feed/entry/media:group/media:thumbnail"]) { 
    NSString *urlString = [currentElementAttributes objectForKey:@"url"];     
    if (urlString != nil && urlString.length > 0) 
     item.thumbnail = urlString; 
    processed = YES; 
} 

另外添加NSString * thumbnail p roperties到MWFeedItem對象

+0

其工作現在tnx – user535351 2011-09-05 12:59:56

相關問題