I am trying to mix dynamic and static cells in a grouped table view: I would like to get two sections with static cells at the top followed by a sec
Thank you applefreak for comprehenisve answer. I'll add my suggestion here that you don't need any section calculations if you add a dummy sections for the static ones. You can even add placeholder elements there. This way you don't have to recreate NSIndexPaths. One important thing is to override each and every method that uses NSIndexPaths as these would crash the app due to array index mismatch.
Also, I gave up using the dequeue mechanism completely and created the cell statically as there weren't that many cells for the dynamic content I had. This makes tableView:cellForRowAtIndexPath: very simple.
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
if (indexPath.section == 0)
{
return _locationCells[indexPath.row];
}
else
{
return [super tableView:tableView cellForRowAtIndexPath:indexPath];
}
}
Just remember the placeholder sections.