title: Working with section headers using NSFetchedResult controller
body: <p>I am new to core data and at the moment I am building a app with the core data model. What I want to achieve is a tableview divided with section headers for each month. At the moment I have the application working that it displays all the data in each cell, but without the section headers for each month. What I want is that the object with "date" : "26/08/2012" shows up below a section with title august.</p>
  
  <p>I have a json webservice with the following data.</p>
  
  <pre><code> "date": "26/08/2012",
      "hour": "18u00",
      "type": "JPL",
      "home": "KRC Genk",
      "away": "Zulte-Waregem",
      "homeScore": "2",
      "awayScore": "0"
  </code></pre>
  
  <p>I build an NSManagedObject subclass of it, and a category of this class to store the values inside the database. This all works.
  For putting these values in the tableview I have the following method.</p>
  
  <pre><code>- (void)getKalender // attaches an NSFetchRequest to this UITableViewController
  {
      NSFetchRequest *request = [NSFetchRequest fetchRequestWithEntityName:@"Kalender"];
      request.sortDescriptors = [NSArray arrayWithObject:[NSSortDescriptor sortDescriptorWithKey:@"date" ascending:YES]];
  
      self.fetchedResultsController = [[NSFetchedResultsController alloc] initWithFetchRequest:request
                                                                          managedObjectContext:self.genkDatabase.managedObjectContext
                                                                            sectionNameKeyPath:nil
                                                                                     cacheName:nil];
  
  }
  </code></pre>
  
  <p>And this is what I do in my cellForRowAtIndexPath</p>
  
  <pre><code>static NSString *simpleTableIdentifier = @"KalenderCell";
  
          KalenderCell *cell = (KalenderCell *)[tableView dequeueReusableCellWithIdentifier:simpleTableIdentifier];
          if ((cell == nil) || (![cell isKindOfClass:KalenderCell.class]))
          {
              NSArray *nib = [[NSBundle mainBundle] loadNibNamed:@"KalenderCell" owner:self options:nil];
              cell = [nib objectAtIndex:0];
          }
  
          // ask NSFetchedResultsController for the NSMO at the row in question
          Kalender *kalender = [self.fetchedResultsController objectAtIndexPath:indexPath];
          // Then configure the cell using it ...
  
          NSDateFormatter *dateFormat = [[NSDateFormatter alloc] init];
          [dateFormat setDateFormat:@"dd/MM"];
         NSString *dateStr = [dateFormat stringFromDate:kalender.date];
          cell.lblType.text           = kalender.type;
          cell.lblHome.text           = kalender.home;
          cell.lblHomeScore.text      = kalender.homeScore;
          cell.lblAwayScore.text      = kalender.awayScore;
          cell.lblAway.text           = kalender.away;
          cell.lblDate.text           = dateStr;
          cell.lblHour.text           = kalender.hour;
  
  
          return cell;
  </code></pre>
  
  <p>But here I am stuck. Can anybody help me how I can set those section headers using the NSFetchedResult controller ?</p>
  
  <p>Many thanks in advance!</p>