RSS reader iOS

* * * * * (11 ratings)
RSS reader | App Code for Sale | Hero

Screenshots

Overview

RSS reader application reads RSS feed and display results in table view. Application is easy to customize and understand how it works. Use it to display RSS feed information from your website or from some other website with interesting feed content.

How To | Edit iPhone App Source Code

Application loads RSSTableViewController and displays all feed items in table view. Each row is one item from feed.

Click on row will open new view that consists of web view and it'll load from link defined in RSS.

Feed is defined in FeedDownloader.m, for sample we use Google news RSS feed.

There are 4 defines:

  • feed URL

  • feed object name

  • feed title

  • link

    // Feed defines #define feedURL @"http://news.google.com/?output=rss" #define feedObject @"item" #define feedTitle @"title" #define feedBody @"link"

Change this defines to match your RSS feed item names. Feed is parsed wirh NSXMLParser:

// NSXMLParser allocation, initialization with content of URL
xmlParser = [[NSXMLParser alloc] initWithContentsOfURL:[NSURL URLWithString:feedURL]];

Each cell in our RSSTableViewControler shows title of feed object.

// Set cell text to feed title
cell.textLabel.text = [[feeds objectAtIndex:[indexPath row]] feedTitle];

Cell shows up to 3 lines of title text. Each cell have disclosure indicator that show user he can tap on cell to view more data. Method didSelectRowAtIndexPath will allocate new WebViewController and it'll show content of link from feed.

// Set up web view to show details
UIViewController *webViewController = [[WebViewController alloc]
initWithNibName:@"WebViewController" bundle:[NSBundle mainBundle]];
[(UIWebView*)webViewController.view setScalesPageToFit:YES];
[webViewController setTitle:[[feeds objectAtIndex:indexPath.row]
feedTitle]];

// Prepare URL
NSString *urlString = [[feeds objectAtIndex:indexPath.row] feedLink];

// URL request
NSURLRequest *request = [NSURLRequest requestWithURL:[NSURL URLWithString:urlString]];

// Show web view
[self.navigationController pushViewController:webViewController animated:YES];

// Load URL request
[(UIWebView*)webViewController.view loadRequest:request];

// Release web view
[webViewController release];
4 Comments Leave a comment

4 Comments

Please login in order to leave a comment.

Newest first
  • kevnm67 Buyer 2013-04-02 19:28:30 Thread #1775

    Can you please add some details as to how to integrate RSS reader in to an existing application? Thanks!

  • RZApplications_34 Buyer 2012-12-27 17:44:25 Thread #892

    Ive have added the code to my project, however when when the project it opens directly to the RSS feed, i dont want it to open right away, I have a button that i want to lead to it but i cant because the RSS feed loads immediately. Also once the feed is clicked the project closes with a sigbart error. Please help.

    • RZApplications_34 Buyer 2012-12-29 00:17:58

      I have made some progress, I have implemented the code into my project. The only problem is that once an item on the table view is clicked, it gets highlighted and does not lead to the news story. Hope you can help.

    • RZApplications_34 Buyer 2012-12-29 00:18:03

      I have made some progress, I have implemented the code into my project. The only problem is that once an item on the table view is clicked, it gets highlighted and does not lead to the news story. Hope you can help.