title: iOS tableView not displaying sections
body: <p>I have a table view that is embedded inside a regular view controller (which is embedded inside a navigation controller.)</p>
  
  <p>Generally speaking, calling methods such as <code>tableView:numberOfRowsInSection:</code>, <code>tableView:titleForHeaderInSection</code> and <code>tableView:cellForRowAtIndexPath:</code> work fine, they are seen and function properly....</p>
  
  <p>Now comes the problem of displaying sections.  For some strange reason the method <code>numberOfSectionsInTableview:</code> is <em>not</em> being seen when the program runs.  I've tested this by inserting <code>NSLog</code>'s as well as inserting breakpoints.  Nothing is being recognized inside this method.  When calling to display sections (I'm organizing it all through <code>NSFetchedResultsController</code>) it only displays the first section when it currently should display 5 (because <code>numberOfSectionsInTableview</code> is not required and defaults to 1.)</p>
  
  <p>I'm thinking this is happening because of my tableView being embedded inside a view controller rather than it actually being a tableview controller.  But if that's the case, why do I not need to do anything special for the other <code>tableView:</code> methods?  As best I can tell, the sectionInfo part of the code (inside the NSFetchedResultsController) is set up properly since the other <code>section</code> methods are working properly (put <code>NSLog</code> inside each one to ensure the method is called.)</p>
  
  <p>Any help you can give at understanding and/or correcting this issue would be greatly appreciated!  Let me know if you need any more info on my code.</p>
  
  <p><strong>EDIT</strong></p>
  
  <p>Here is all the code I'm using as it relates to this field:</p>
  
  <pre><code>- (NSFetchedResultsController *)fetchedResultsController {
  if (fetchedResultsController == nil) {
  
      NSFetchRequest *fetchRequest = [[NSFetchRequest alloc] init];
  
      NSEntityDescription *entity = [NSEntityDescription entityForName:@"ActiveList" inManagedObjectContext:self.managedObjectContext];
      [fetchRequest setEntity:entity];
  
      NSSortDescriptor *sortDescriptor1 = [NSSortDescriptor sortDescriptorWithKey:@"category" ascending:YES];
      NSSortDescriptor *sortDescriptor2 = [NSSortDescriptor sortDescriptorWithKey:@"name" ascending:YES];
      [fetchRequest setSortDescriptors:[NSArray arrayWithObjects:sortDescriptor1, sortDescriptor2, nil]];
  
      //[fetchRequest setSortDescriptors:@[ sortDescriptor1, sortDescriptor2 ]];
  
      // Only retrieves items where 'isActive' SQLite field is '1' or 'YES'
      NSPredicate *predicate = [NSPredicate predicateWithFormat:@"isActive == %@", [NSNumber numberWithBool:YES]];
      [fetchRequest setPredicate:predicate];
  
      [fetchRequest setFetchBatchSize:20];
  
      fetchedResultsController = [[NSFetchedResultsController alloc]
                                initWithFetchRequest:fetchRequest
                                managedObjectContext:self.managedObjectContext
                                sectionNameKeyPath:@"category"
                                cacheName:@"ActiveLists"];
  
  
      fetchedResultsController.delegate = self;
  }
  return fetchedResultsController;
  }
  
  - (void)performFetch {
  
  NSError *error;
  if (![self.fetchedResultsController performFetch:&amp;error]) {
      FATAL_CORE_DATA_ERROR(error);
      return;
  }
  }
  
  - (void)viewDidLoad
  {
  [super viewDidLoad];
  
  
  [self performFetch];
  
  }
  
  - (NSInteger)numberOfSectionsInTableview:(UITableView *)tableView {
  return [[self.fetchedResultsController sections] count];
  }
  
  - (NSString *)tableView:(UITableView *)tableView titleForHeaderInSection:(NSInteger)section {
  id &lt;NSFetchedResultsSectionInfo&gt; sectionInfo = [[self.fetchedResultsController sections] objectAtIndex:section];
  return [sectionInfo name];
  }
  </code></pre>