title: How to properly configure NSFetchedResultsController
body: <p>I am placing an NSFetchedResultsController into my code so I get that nice automatic sectioning of my table view data.</p>
  
  <p>So I am running a test to make sure everything works properly. I have a single Book entity in my persistent store. I will first perform the fetch the old way, then I will try to use NSFetchedResultsController. The difference between the 2 blocks of code is just 2 lines.</p>
  
  <p>Code <em>without</em> NSFetchedResultsController:</p>
  
  <pre><code> NSFetchRequest *request = [[NSFetchRequest alloc] init];
   NSEntityDescription *entity = [NSEntityDescription entityForName:kBookEntityName inManagedObjectContext:self.managedObjectContext];
   [request setEntity:entity];
  
   NSSortDescriptor *sortDescriptor = [[NSSortDescriptor alloc] initWithKey:@"title" ascending:NO];
   NSArray *sortDescriptors = [[NSArray alloc] initWithObjects:sortDescriptor, nil];
   [request setSortDescriptors:sortDescriptors];
   [sortDescriptor release];
   [sortDescriptors release];
  
    //The following 2 lines will be replaced by the NSFetchedResultsController
   NSMutableArray *mutableFetchResults = [[[self.managedObjectContext executeFetchRequest:request error:nil] mutableCopy] autorelease];
   Book *result = (Book*)[mutableFetchResults objectAtIndex:0];
  
   NSString* title = [result valueForKey:@"title"];
   NSString* priority = [result valueForKeyPath:@"priority.name"];
  
  
   [request release];
  </code></pre>
  
  <p>Now I substitute in the lines for the NSFetchedResultsController:</p>
  
  <pre><code>NSFetchedResultsController* fetchedResultsController = [[NSFetchedResultsController alloc] initWithFetchRequest:request managedObjectContext:self.managedObjectContext sectionNameKeyPath:@"title" cacheName:@"BookList"];                                                                                                                                                                                                                                                                                                           
  
  Book *result = (Book*)[fetchedResultsController objectAtIndexPath:[NSIndexPath indexPathForRow:0 inSection:0]];
  </code></pre>
  
  <p>Seems pretty cut and dry. The first code block properly fetches the single Book entity. The code with the NSFetchedResultsController, however, does not. Instead it returns nil. </p>
  
  <p>My question is: Am I properly configuring the NSFetchedResultsController in this example?</p>
  
  <p>(note, the fetchedObjects property of the NSFetchedResultsController is also nil)</p>