如何启用无效的"didSelectRowAtIndexPath".并禁用它? [英] How to enable void "didSelectRowAtIndexPath" and disable it?
问题描述
我搜索didSelectRowAtIndexPath这个关键字
I search didSelectRowAtIndexPath this key word
发现最大的问题是如何触发
And found most problem is how to trigger it
但是我的问题是如何在其他条件下启用它
But my question is how to enable it with another conditions
您可以在此处查看我的最后一个问题-如何添加收音机表格视图中的按钮
You can check my last question here - How to add a radio button in tableview
当未选中单选按钮时如何禁用此空白????
how To disable this void when the radio button is not selected ???
-(void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {}
推荐答案
我对您的问题有点困惑,但是据我所知,您想防止在某些情况下选择tableView行吗?为此,您将要使用 tableView:willSelectRowAtIndexPath:
.如果从该方法返回 nil
,tableView将不会选择一行.您可能会发现阅读文档用于 UITableViewDelegate
.
I'm a bit confused by your question, but from what I can tell, you want to prevent a tableView row from being selected under certain conditions? For that you'll want to use tableView:willSelectRowAtIndexPath:
. If you return nil
from that method the tableView will not select a row. You may find it helpful to read the documentation for UITableViewDelegate
.
这篇关于如何启用无效的"didSelectRowAtIndexPath".并禁用它?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!