Iphone 单元视图公开按钮及相关方法

Iphone 单元视图公开按钮及相关方法,iphone,uitableview,Iphone,Uitableview,我一直在和一个手机泄露按钮搏斗。。。首先,它说它在我使用时被贬值了: -(UITableViewCellAccessoryType)tableView:(UITableView *)tableView accessoryTypeForRowWithIndexPath:(NSIndexPath *)indexPath { return UITableViewCellAccessoryDetailDisclosureButton; } 因此,我对其进行了注释,并使用以下方法将披露添加到confi

我一直在和一个手机泄露按钮搏斗。。。首先,它说它在我使用时被贬值了:

-(UITableViewCellAccessoryType)tableView:(UITableView *)tableView accessoryTypeForRowWithIndexPath:(NSIndexPath *)indexPath {
 return UITableViewCellAccessoryDetailDisclosureButton;
}
因此,我对其进行了注释,并使用以下方法将披露添加到configureCell中的单元格中:

cell.accessoryType = UITableViewCellAccessoryDisclosureIndicator;
cell.editingAccessoryType = UITableViewCellAccessoryNone;

然而现在我的“披露”按钮什么也没做。我需要添加什么才能使“披露”按钮正常工作。我在谷歌上找到的都是其他被贬低的方法。非常感谢您的帮助或指点。

在表视图委托中使用此方法

    - (void)tableView:(UITableView *)tableView accessoryButtonTappedForRowWithIndexPath:(NSIndexPath *)indexPath

如果确实需要“详细信息披露”按钮,请确保将单元格附件类型设置为
uitableViewCellAccessorDetailDisclosureButton
。(示例代码显示的是
UITableViewCellAccessoryDisclosureIndicator
)您在表视图代理的
tableView:accessoryButtonTappedForRowWithIndexPath:
方法中处理细节披露按钮点击。您可以在表视图代理的
tableView:didSelectRowAtIndexPath:
方法中处理行选择(无论附件视图是什么)

Swift 3.0中的委托方法

func tableView(_ tableView: UITableView, accessoryButtonTappedForRowWith indexPath: IndexPath) {

}
但要使用此委托: 您可以使用以下两种附件类型之一:

cell.accessoryType = .detailDisclosureButton
cell.accessoryType = .detailButton

这就是我错的地方。我有一个圆圈中的图标,它只是>而不是>,因此当我将类型更改为UITableViewCellAccessoryDetailDisclosure按钮时,它与以前一样工作。谢谢你的提醒,我已经在用这个了,结果是因为我用的是UITableViewCellAccessoryDispositionIndicator不是UITableViewCellAccessoryDetailDispositionButton,所以它没有叫它:)现在都修好了。谢谢你的帮助