Ios 如何检索详细信息披露按钮';你的观点是什么?

Ios 如何检索详细信息披露按钮';你的观点是什么?,ios,uitableview,Ios,Uitableview,我有一个UITableView,上面有单元格,带有详细信息披露指示器(UITableViewCellAccessorDetailDisclosure按钮) 我需要详细信息披露按钮的视图(从中显示一些自定义弹出菜单),但它总是空的。为什么? -(void)tableView:(UITableView *)tableView accessoryButtonTappedForRowWithIndexPath:(NSIndexPath *)indexPath{ UITableViewCell *cell

我有一个UITableView,上面有单元格,带有详细信息披露指示器(UITableViewCellAccessorDetailDisclosure按钮)

我需要详细信息披露按钮的视图(从中显示一些自定义弹出菜单),但它总是空的。为什么?

-(void)tableView:(UITableView *)tableView accessoryButtonTappedForRowWithIndexPath:(NSIndexPath *)indexPath{
UITableViewCell *cell = [self.tableView cellForRowAtIndexPath:indexPath];
[self showMenu: cell.accessoryView];
NSLog(@"%@",cell.accessoryView);}
我如何将披露按钮的视图检索为UIVIew*? (注意,我有披露按钮,并为此触发了点击事件)


提前谢谢

通过检查单元格子视图,可以找到附件按钮:

- (void)tableView:(UITableView *)tableView accessoryButtonTappedForRowWithIndexPath:(NSIndexPath *)indexPath
{
    UITableViewCell *cell = [self.tableView cellForRowAtIndexPath:indexPath];
    //[self showMenu: cell.accessoryView];
    NSLog(@"%@",cell.accessoryView);

    NSArray *subviews = [cell subviews];

    for (UIView *subview in subviews) {
        if ([subview isKindOfClass:[UIButton class]]) {
            NSLog(@"This is that button");
        }
    }
    NSLog(@"Subviews: %@", subviews);
}

从“披露”按钮连接一个插座如何?表不是静态的,我有很多动态数据单元格,它们都有详细披露按钮stry cell.accessoryType;如果我的手机里有更多的按钮呢?真的是这样吗?对我来说似乎很奇怪me@Tom我也这么想,但是如果添加正确,这些按钮应该在你的cell.contentView中,而不仅仅是作为单元格本身的子视图。你的方法为每个单元格返回相同的UIButton…位置也应该相同()。当然,单元格中的每个按钮都应该具有相同的帧,但实际对象不同。我的两支是和。您可以看到它们是不同的。@Tom如果您的方法与我刚才编辑的方法完全相同,那么我确信此方法将为您提供每个单元格的按钮。绝对不是每次都一样。