RSS Feed Almost there...

Discussion in 'iOS Programming' started by nashyo, Mar 8, 2012.

  1. nashyo macrumors 6502


    Oct 1, 2010
    I've written some code that presents a UITableView with the following rss feed @"".

    I currently parse the file using NSXMLParser, successfully, and generate an NSDictionary containing the link for each feed.

    - (void)parser:(NSXMLParser *)parser didEndElement:(NSString *)elementName namespaceURI:(NSString *)namespaceURI qualifiedName:(NSString *)qName{     
    	//NSLog(@"ended element: %@", elementName);
    	if ([elementName isEqualToString:@"item"]) {
    		// save values to an item, then store that item into the array...
    		[item setObject:currentTitle forKey:@"title"];
    		[item setObject:currentLink forKey:@"link"];
    		[item setObject:currentSummary forKey:@"summary"];
    		[item setObject:currentDate forKey:@"date"];
    		[stories addObject:[item copy]];
    		NSLog(@"adding story: %@", currentTitle);
    However, how can I generate a View layout thet summarises the feed, similar to how mail does it with feeds (in following image) ? I like the 'read more' button too.

    I assume I just pass an object from the dictionary over to a new view on the stack, once a feed is selected.

  2. seepel macrumors 6502


    Dec 22, 2009
    I think your best bet is to display the content in a UIWebView as a lot of RSS feeds spit out HTML anyway. Then for the header and read more link you can inject your own HTML code sandwiching the content.
  3. MattInOz macrumors 68030


    Jan 19, 2006
    To me it's looks like each item or sticky note graphic is a custom UITableViewCell subclass. Likely one that receives one of your item objects and assigns text of the attributes of that object to various UILabels laid out within that cell.

Share This Page