I have a UITableView that is editable. I am commiting changes via:
- (void)tableView:(UITableView *)tableView commitEditingStyle:(UITableViewCellEditingStyle)editingStyle forRowAtIndexPath:(NSIndexPath *)indexPath
While in edit mode, I would like the user to be able to select a row, which will push a new view. I am not sure how to do this. I suspect it will be in:
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
But how can I determine if the user is in edit mode or not?
UPDATE:
Edit Mode is toggled via:
self.navigationItem.rightBarButtonItem = self.editButtonItem;
To allow selection during editing you need to set the
allowsSelectionDuringEditingproperty ofUITableViewto YES. Then it will call thedidSelectRowAtIndexPathmessage. You can find more information about that property here:http://developer.apple.com/iphone/library/documentation/uikit/reference/UITableView_Class/Reference/Reference.html#//apple_ref/occ/instp/UITableView/allowsSelectionDuringEditing
Then, you can see if the user is in edit mode by running code like the following: