gpt4 book ai didi

ios - Accessory Tapped 未在 UITableView 中触发 segue

转载 作者:行者123 更新时间:2023-11-29 10:58:50 32 4
gpt4 key购买 nike

我有一个带有静态单元格的表格 View 。我正在使用 cellForRowAtIndexPath: 创建我的单元格。其中之一以编程方式添加了一个披露附件指示器。其各自的方法是这样的:

- (void)tableView:(UITableView *)tableView accessoryButtonTappedForRowWithIndexPath:(NSIndexPath *)indexPath{
NSLog(@"aBTFRAIP:accessory tapped");
}

但是控制台没有日志。当我点击该单元格时,该单元格的 didSelectRowAtIndexPath: 方法会触发。我该如何解决这个问题?

最佳答案

accessoryButtonTappedForRowWithIndexPath: 方法适用于详细信息披露按钮(蓝色按钮),并且仅当按钮本身被点击时才起作用,而不是在单元格上被点击。

如果您点击单元格 didSelectRowAtIndexPath: 将被触发,并且不会 accessoryButtonTappedForRowWithIndexPath: 如您所愿。

关于ios - Accessory Tapped 未在 UITableView 中触发 segue,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/17000611/

32 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com