didSelectRowAtIndexPath: not being called

前端 未结 14 2283
轻奢々
轻奢々 2020-11-29 18:57

I have a UITableView as a subview of my UIScrollVIew, which is the main view controlled by my MainViewController.

In MainView

14条回答
  •  猫巷女王i
    2020-11-29 19:10

    I was having this issue for a while, and I did not see any reference to it here, so for reference, another reason for this could be that:

    tableView.editing = YES;
    

    but

    tableView.allowsSelectionDuringEditing = NO;
    

    As per documentation for

    - tableView:didSelectRowAtIndexPath:
    

    This method isn’t called when the editing property of the table is set to YES (that is, the table view is in editing mode). See "Managing Selections" in Table View Programming Guide for iOS for further information (and code examples) related to this method.

提交回复
热议问题