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
.
精彩评论