Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/iphone/41.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Iphone 设置UITableViewCell中DetailDisclosure按钮的操作_Iphone_Uitableview - Fatal编程技术网

Iphone 设置UITableViewCell中DetailDisclosure按钮的操作

Iphone 设置UITableViewCell中DetailDisclosure按钮的操作,iphone,uitableview,Iphone,Uitableview,我已在我的应用程序中设置UITableViewCell productsCell.accessoryType = UITableViewCellAccessoryDetailDisclosureButton;//productCell is of type UITableViewCell 以前使用过此accessoryAction属性。但现在它被弃用了 如何做到这一点。 提前感谢。在您的学员中实施此方法: - (void)tableView:(UITableView *)tableView a

我已在我的应用程序中设置UITableViewCell

productsCell.accessoryType = UITableViewCellAccessoryDetailDisclosureButton;//productCell is of type UITableViewCell
以前使用过此accessoryAction属性。但现在它被弃用了

如何做到这一点。
提前感谢。

在您的学员中实施此方法:

- (void)tableView:(UITableView *)tableView accessoryButtonTappedForRowWithIndexPath:(NSIndexPath *)indexPath
indexPath
将指向被点击的辅助单元

或者试试这个:

UITableViewCell *cell;
UITapGestureRecognizer *recognizer = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(accessoryTapped)];
[cell.accessoryView addGestureRecognizer:recognizer];
[recognizer release];

我做到了。但方法没有被调用。请确保我使用的是UITableViewCell的单个单元格。我没有使用UITableView。您使用的是没有表格的单元格吗?是的。我使用它没有手机。在我的需求表格视图中不适合。那么我只能建议将
uitappesturerecognizer
添加到您的
单元格中。accessoryView