title: Show custom label when no data available for tableView
body: <p>The app in question has an ability for users to mark items as favourite.  When the user has no favourites saved, I'd like to notify them of the fact (mostly I hate the idea of a blank tableView). </p>
  
  <p>My <code>numberOfRowsInSection</code> is zero when there are no items the user has marked as favourite.  I'd like to set cell.textLabel.text = @"You have no favourites" but when there are no items for the table <code>cellForRowAtIndexPath</code> is not called.</p>
  
  <p>I could test <code>numberOfRowsInSection</code> to give a result when it encounters a 0 and then test for 1 row in <code>cellForRowAtIndexPath</code> and then insert the custom text but then what if they only have one favourite?</p>
  
  <p>UPDATE</p>
  
  <p>I tried implementing the idea I had above, and recommended below, but perhaps I'm not doing it right, probably due to the fact that it's a fetchedResultsController with the delegate methods to update the table when a change occurs.</p>
  
  <p>I get this error when I delete the cell when there is but one cell in the table:</p>
  
  <p><code>*** Assertion failure in -[UITableView _endCellAnimationsWithContext:], /SourceCache/UIKit_Sim/UIKit-1447.6.4/UITableView.m:976
  Serious application error.  An exception was caught from the delegate of NSFetchedResultsController during a call to -controllerDidChangeContent:.  Invalid update: invalid number of rows in section 0.  The number of rows contained in an existing section after the update (1) must be equal to the number of rows contained in that section before the update (1), plus or minus the number of rows inserted or deleted from that section (0 inserted, 1 deleted). with userInfo (null)</code></p>
  
  <p>and when there are no cells to be displayed in the first place it crashes with:</p>
  
  <p><code>*** Terminating app due to uncaught exception 'NSRangeException', reason: '*** -[_PFBatchFaultingArray objectAtIndex:]: index (0) beyond bounds (0)'</code></p>
  
  <p>Here is the relevant code:</p>
  
  <pre><code>- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {
      // Return the number of rows in the section.
      id &lt;NSFetchedResultsSectionInfo&gt; sectionInfo = [[_fetchedResultsController sections] objectAtIndex:section];
  
      if ([sectionInfo numberOfObjects]==0) {
          return 1;
      } else {
          return [sectionInfo numberOfObjects];
      }
  } 
  
  - (void)configureCell:(UITableViewCell *)cell atIndexPath:(NSIndexPath *)indexPath {
  
  if ([[_fetchedResultsController sections] objectAtIndex:0]==0) {
      cell.textLabel.text = @"You have no favorites";
  } else {
      Shows *show = [_fetchedResultsController objectAtIndexPath:indexPath];
  
      cell.textLabel.text = show.ShowsToSerials.serialName;
      cell.detailTextLabel.text = [NSString stringWithFormat:@"%@", show.showTitle];
  }
  }
  </code></pre>