I am using the following code to edit a uitableview, but i’d like only one section to be editable – how should I do that? I cant seem to have access to “section” in the editing function below.
in viewDidLoad:
self.navigationItem.rightBarButtonItem = self.editButtonItem;
Editing function:
- (void)setEditing:(BOOL)editing animated:(BOOL)animated {
[super setEditing:editing animated:animated];
[tblSimpleTable setEditing:editing animated:YES];
if (editing) {
editButton.enabled = NO;
} else {
editButton.enabled = YES;
}
}
Thank you.
The logic for that goes in
-tableView:canEditRowAtIndexPath:of your table view controller (data source), like so:If you’re subclassing
UITableViewController, you should be able to find this among the stub methods commented out beneath-tableView:cellForRowAtIndexPath:.