Apple's documentation on UITableView discusses how to add/edit/delete rows, but it doesn't discuss adding/editing/deleting sections is detail, specially with respect to the UI. In case of add/delete rows, you can apply "add" and "delete" styles on the row using:
- (UITableViewCellEditingStyle)tableView:(UITableView *)tableView editingStyleForRowAtIndexPath:(NSIndexPath *)indexPath;
However, there is no such method for sections (that i know of), which can be used to show visual controls to the user for adding "+" or deleting "-" sections. I can add a new section using the logic used for new row, however, I'm not sure how to go about deleting the whole section (or allowing the user to edit section e.g. section heading). How should i go about deleting the whole section?
Background: I'm working on a Core Data based application. I have a one to many relationship between entities.
Entity r (root) <-->> Entity p (parent),
Entity p (parent) <-->> Entity c (child)
When user creates a parent record (entity p), fixed set of child records are automatically created (entity c). In the UI, I'm showing basic information of parent (entity p) in the header e.g. title, and the associated child records (entity c) as section rows, and some summary in the footer. For some logical reasons, i can't opt for drill-down approach (to avoid adding/removing sections).