Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

When editing, `UITableView` does not call didSelectRowAtIndexPath ??

I have a UITableViewController where the user should be able to edit the items. In order to enable editing I use this :

self.navigationItem.rightBarButtonItem = self.editButtonItem; 

For everyone who does not know where self.editButtonItem comes from, it is predefined by the SDK.

So, now when I press on any item, this method is called :

- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath  

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 ?

This is the rest of the code that is related to editing :

// Override to support conditional editing of the table view. - (BOOL)tableView:(UITableView *)tableView canEditRowAtIndexPath:(NSIndexPath *)indexPath  {     // Return NO if you do not want the specified item to be editable.     return YES; }  - (UITableViewCellEditingStyle)tableView:(UITableView *)tableView editingStyleForRowAtIndexPath:(NSIndexPath *)indexPath  {     return UITableViewCellEditingStyleNone; }   - (BOOL)tableView:(UITableView *)tableView shouldIndentWhileEditingRowAtIndexPath:(NSIndexPath *)indexPath  {     return NO; } 

Thanks for the help.

mcb

like image 951
elementsense Avatar asked Jun 15 '10 17:06

elementsense


1 Answers

You gotta set the allowsSelectionDuringEditing property of UITableView to true.

Reference: UITableView - allowsSelectionDuringEditing

like image 183
Daniel Avatar answered Sep 23 '22 19:09

Daniel