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

Chapter 9: Managing Table Views Using a ... > Implementing the NSFetchedResultsCon...

Implementing the NSFetchedResultsController

The NSFetchedResultsController's job is to fetch data from the persistent store and provide this data to the table view controller as necessary. To get started, import the Core Data headers in AllPlayerViewController.h, like so:

#import <CoreData/CoreData.h>

Create a property in AllPlayerViewController.h to store the NSFetchedResultsController instance. Also, create a property to store the NSManagedObjectContext from which your NSFetchedResultsController will fetch its data. These properties look like this:

@property (nonatomic, retain) NSFetchedResultsController *fetchedResultsController;
@property (nonatomic, retain) NSManagedObjectContext *managedObjectContext;

Add code to AllPlayerViewController.m to synthesize getters and setters for these properties.


  

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


  
  • Safari Books Online
  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint