附件ButtonTappedForRowWithIndexPath:没有被调用 [英] accessoryButtonTappedForRowWithIndexPath: not getting called

查看:20
本文介绍了附件ButtonTappedForRowWithIndexPath:没有被调用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在创建一个详细信息披露按钮,该按钮使用数组填充....但是,我的类中没有调用附件ButtonTappedForRowWithIndexPath: 函数.它是一个 TableviewDelegateTableviewDatasource 委托.

I am creating a Detail disclosure button which is getting populated using an array.... However the accessoryButtonTappedForRowWithIndexPath: function is not being called in my class. It is a TableviewDelegate and TableviewDatasource delegate.

- (void)tableView:(UITableView *)tableView accessoryButtonTappedForRowWithIndexPath:(NSIndexPath *)indexPath{
    NSLog(@"reaching accessoryButtonTappedForRowWithIndexPath:");
    [self performSegueWithIdentifier:@"modaltodetails" sender:[self.eventsTable cellForRowAtIndexPath:indexPath]];
}

NSLog 没有打印到控制台,这让我相信函数没有被调用......这当然是当我在单元格上选择时.下面的屏幕截图显示了我如何设置我的单元格.

The NSLog isnt printing to console which leads me to believe the function isnt being called... This is of course when I select on a cell. A screenshot below shows how I have my cell setup.

推荐答案

你是直接点击单元格来选择它还是你真的点击了单元格上的辅助按钮指示器?从你的问题看不清楚.

Did you just click on the cell to select it or did you actually click on the accessory button indicator on the cell? It isn't clear from your question.

accessoryButtonTappedForRowWithIndexPath 适用于单击单元格内的按钮图标而不是选择单元格时.

accessoryButtonTappedForRowWithIndexPath is applicable when you click on the button icon within the cell and not when you select the cell.

这篇关于附件ButtonTappedForRowWithIndexPath:没有被调用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆