开发者

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

开发者 https://www.devze.com 2023-01-03 10:18 出处:网络
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?

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

精彩评论

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