我如何检索详细信息披露button的视图?

我有一个UITableView单元与细节披露指标(UITableViewCellAccessoryDe​​tailDisclosureButton)。

我需要详细披露button的视图(显示一些自定义的popup菜单),但它始终为空。 为什么?

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

我如何检索泄露button的视图为UIVIew *? (注意,我有披露button,点击事件被激发)

提前致谢!

您可以通过检查单元格子视图来find附件button:

 - (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); }