Last Updated: February 25, 2016
·
6.197K
· netbe

tableView:didSelectRowAtIndexPath: not working

As I now try to use more and more Interface Builder, I stumbled upon (twice) on a bug where I had my tableView done in IB and could not see why - tableView:didSelectRowAtIndexPath: was never triggered.

The dataSource and delegate were correctly set and no views were on top of the tableView.

The issue was on IB with the properties of the UITableView : Selection set to No Selection

The properties in code:

@property (nonatomic) BOOL allowsSelection NS_AVAILABLE_IOS(3_0); // default is YES. Controls whether rows can be selected when not in editing mode

@property (nonatomic) BOOL allowsSelectionDuringEditing; // default is NO. Controls whether rows can be selected when in editing mode