uitableviewdynamicnsfetchedresultscontrollerdequesectionheader

How to load section header dynamically like cells are loaded


I have a UITableView with a lot of rows and a lot of sections (over 500 sections). Having a lot of rows is not so bad, because only the visible rows are loaded using the dequeueReusableCellWithIdentifier method. The problem is that ALL of the section headers are loaded each time i perform [tableView reloadData].

Is there a way to use dequeued section headers the same way i use it for rows?

If not, the only two options i can think of is:

  1. handling the section header queue my self.
  2. Making the section headers to be custom cells and managing the section-cell mapping my self.

Both solutions are very complicated because i use NSFetchedResultsController.


Solution

  • This issue was solved in iOS6 with: UITableView's dequeueReusableHeaderFooterViewWithIdentifier method.