-didSelectRowAtIndexPath: 没有被调用 [英] -didSelectRowAtIndexPath: not being called
问题描述
我正在编写一个在选项卡视图中带有表视图的 iOS 应用程序.在我的 UITableViewController
中,我实现了 -tableView:didSelectRowAtIndexPath:
,但是当我在运行时选择一行时,并没有调用该方法.表格视图正在被填充,所以我知道我的控制器中的其他 tableView 方法正在被调用.
I'm writing an iOS app with a table view inside a tab view. In my UITableViewController
, I implemented -tableView:didSelectRowAtIndexPath:
, but when I select a row at runtime, the method isn't being called. The table view is being populated though, so I know that other tableView methods in my controller are being called.
有没有人知道我为了实现这件事而搞砸了什么?
Does anyone have any ideas what I may have screwed up to make this happen?
推荐答案
另一个可能导致问题的原因是未选择选择种类:
Another thing that might lead to the issue is not selected selection kind:
正常选择应该是Single Selection
,应该不是No Selection
.
Should be Single Selection
for normal selection, should not be No Selection
.
要以编程方式执行此操作,请执行以下操作:
To do this programmatically, do:
tableView.allowsSelection = YES
这篇关于-didSelectRowAtIndexPath: 没有被调用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!