Free Trial

Safari Books Online is a digital library providing on-demand subscription access to thousands of learning resources.


  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint
Share this Page URL
Help

29. Advanced MVCS > Read and Unread Items

Read and Unread Items

Now that you can cache both RSS feeds, let’s add another useful feature: when the user selects an RSSItem, we want the ListViewController to add an indicator to the table that shows that this item has been read (Figure 29.7). Even if the user closes the application, the list of read items should persist. Nerdfeed, then, needs to store the list of read RSSItems on the filesystem.

Figure 29.7  RSSItems marked as read

RSSItems marked as read

The simplest way to add this feature would be to add a hasBeenRead Boolean instance variable to RSSItem. When the user tapped on a row, the corresponding RSSItem would change its value of hasBeenRead to YES. For each row in the table, a checkmark would be displayed if the corresponding RSSItem’s hasBeenRead variable is YES.


  

You are currently reading a PREVIEW of this book.

                                                                                        

Get instant access to over
$1 million worth of books and videos.

  

Start a Free Trial