'Add new item ...' not selectable


#1

When in edit mode with the sample application for this chapter, we have a row in the table which has a ‘+’ and then the cell text we return is ‘Add new item …’. This works fine if you tap the ‘+’ but unfortunately, if you tap on the row itself nothing happens. Clearly, we would want the same action in either case. Unfortunately, it’s not entirely obvious to me how to fix this … any help would be appreciated.


#2

You could implement tableView:didSelectRowAtIndexPath: to handle what happens when you select that row - which would be to call the same code you would normally call when the plus button is tapped.


#3

Except that method isn’t called when in Edit mode, which is the only time that cell is displayed. I’m sure there’s some other method which filters this, but I’m not sure what it is.


#4

Hi,

[[self tableView] setAllowsSelectionDuringEditing:YES];

Gareth


#5

Thanks - just what I was looking for.