I have a UITableView populated with a standard NSFetchedResultsController. However I’d like to prepend a row or a section (row preferably but either would works fine really.)
The only way I can possibly see doing this right now is to rewrite all the NSIndexPath’s manually when dealing with the section/rows dealing with the data from NSFetchedResultsController to trick it into seeing section at index 0 and starting with row at index 0. This however seems like a really bad idea that would quickly get confusing so I’d like to preferable avoid that.
A good example of this would be in the official Twitter app when you start it up for the first time and I walks you through adding some people from your friends list.

The red section is pretty much what I’d like to achieve, and the yellow section I assume is the results from an NSFetchedResultsController in the same section (though with their custom styling it might be a separate section.)
This is possible to do in a fairly clean way.
I’m assuming you’re starting with a standard tableview set up with a standard NSFetchResultsController that uses Apple’s sample code.
First you need two utility functions:
These should be fairly self explanatory – they’re just helpers to deal with adding the extra row when we want to use an index path from the fetched results controllers to access the table, or removing it when going the other way.
Then we need to create the extra cell:
make sure we configure it correctly (configurecell will only be called for cells from the fetch results controller):
and tell the tableview it exists:
and respond to selection:
and then remap any updates we get from the results controller: