开发者

How do get the view that is the tapped detail-disclosure-button

The cell in this iPhone TableView definitely has a Detail-Disclosure-Button.

When I tap it... shouldn't this code give me access to the button?

Instead detailButton is always just null.

- (void) tableView:(UITableView *)tableView accessoryButtonTappedForRowWithIndexPath:(NSIndexPath *)indexPath
{
    UITableViewCell开发者_StackOverflow中文版 *aCell = [tableView cellForRowAtIndexPath:indexPath];
    UIButton *detailButton = (UIButton *)[aCell accessoryView];
}


are you over-riding the cell accessory button in 'cellForRowAtIndexPath' by any chance?


accessoryView is provided for your own customization, to override accessoryType. The table view cell will internally handle whatever you assign to accessoryType without affecting accessoryView.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜