GDataXML Rss Parsing - 如何手动设置获取的项目数?

时间:2012-08-07 13:06:02

标签: iphone ios xcode cocoa-touch rss

我正在使用GDataXML解析Feed。 但它只解析10-20篇文章。我想解析更多 - 比如50.我该怎么做?

以下是我解析rss feed的方法:

-(NSArray *)parseRSSFeed:(GDataXMLElement *) rootElement
{
    NSMutableArray *entries = [[NSMutableArray alloc] init];
    NSArray *channels = [rootElement elementsForName:@"channel"];
    for (GDataXMLElement *channel in channels) {
        NSArray *items = [channel elementsForName:@"item"];
        for (GDataXMLElement *item in items) {
            FeedItem *itemF = [[FeedItem alloc] init];
            itemF.title = [item valueForChild:@"title"];
            itemF.description = [item valueForChild:@"description"];
           // NSArray *components = [itemF.description componentsSeparatedByString:@"<img"];
            itemF.dateString = [item valueForChild:@"pubDate"];
            itemF.link = [NSURL URLWithString:[item valueForChild:@"link"]];
            NSLog(@"%@", itemF.link);
            itemF.dateString = [item valueForChild:@"updated"];
            itemF.author = [item valueForChild:@"author"];
            [entries addObject:itemF];
            NSLog(@"RSS - %@", itemF.title);
        }
    }
    NSArray *RSSArray = [entries copy];
    return RSSArray;
}

感谢。

0 个答案:

没有答案