I have a UITableViewController where the user should be able to edit the items. In order to enable editing I use this :
self.navigationItem.righ
but as soon as I hit the edit button and while editing is active, this method does not seemed to be called.
Any idea what I missing ?
Yes. You are expecting tableView:didSelectRowAtIndexPath: to be called when a button in your nav bar is tapped. This will never happen. That method is only called when a row is selected.
When the edit button is tapped, you will want to put your table into editing mode. In your view controller:
- (void)setEditing:(BOOL)editing animated:(BOOL)animated
{
[super setEditing:editing animated:animated]; // must be called first according to Apple docs
[self.tableView setEditing:editing animated:animated];
}
Then you handle editing events by adding a tableView:commitEditingStyle:forRowAtIndexPath: method.