Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

nashyo

macrumors 6502
Original poster
Oct 1, 2010
299
0
Bristol
I've written some code that presents a UITableView with the following rss feed @"http://www.bristol.ac.uk/news/news-feed.rss".

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

Code:
- (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.

313n2xj.png
 
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.
 
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.
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.