views:

718

answers:

1

If I create a UITableViewController - drilling down works as expected. If a user selects a cell and I implement 'didSelectRowAtIndexPath', the cell flashes blue and the next view shows up.

But, if I include an 'edit' button (self.navigationItem.rightBarButtonItem = self.editButtonItem), when the user clicks 'Edit' - the mode correctly changes (all the cells indent and paint an appropriate editingAccessory), ... BUT, the cells are no long 'selectable'.

IE: while in edit mode, when a user selects a cell, nothing is happening. No blue flash. No invocation of 'didSelectRowAtIndexPath', nothing.

When I open the iPhone example 'iPhoneCoreDataRecipes' (as provided in the SDK docs), sure enough, they have a RecipeDetailViewController - that, when put into edit mode, still allows you to drill down. I've downloaded and built their example and it works just fine. I can't seem to find any trickery in their code to enable this 'selectable cell when in edit mode behavior' but I'm just not getting it when I do it.

Thoughts?

Thanks for any time,

-Luther

+8  A: 

UITableView has a property allowsSelectionDuringEditing for this.

IMHO it should have been YES by default.

NWCoder
You may have missed it in the sample code you spoke of, because it can also be set in Interface Builder.
NWCoder