【发布时间】:2010-06-30 18:30:57
【问题描述】:
当我单击 tableView 的详细信息按钮时...我可以设法获取节号、行号甚至单元格本身...但是为什么无法获得实际的“详细信息按钮”? (NSLog 总是为按钮显示“(null)”。)
- (void) tableView:(UITableView *)tableView accessoryButtonTappedForRowWithIndexPath:(NSIndexPath *)indexPath
{
int section = indexPath.section;
int row = indexPath.row;
UITableViewCell *aCell = [tableView cellForRowAtIndexPath:indexPath];
UIButton *detailButton = (UIButton *)[aCell accessoryView];
// Why is detailButton null?
NSLog(@"accessory button tapped for row with index path %d x %d \n cell=(%@) \n button=(%@)", section, row, aCell, detailButton);
}
【问题讨论】:
标签: iphone uitableview accessorytype accessoryview