iOS: UITabelView - didSelectRowAtIndexPath is not called
I had come across a problem which didSelectRowAtIndexPath doesn’t execute when I tap the cell.
1 | - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath |
No matter how I tap, it doesn’t show the log.
As shown in the attribute inspector, the Selection is not none
, User Interaction Enabled is also checked
.
Finally, I found the problem…
1 | - (NSIndexPath *)tableView:(UITableView *)tableView willSelectRowAtIndexPath:(NSIndexPath *)indexPath |
I forgot to remove willSelectRowAtIndexPath
in ViewController.