I ended up working around this using a protocol for custom table cells.
CustomAccessoryTableCellDelegate.h
@protocol CustomAccessoryTableCellDelegate <NSObject>
@required
- (void) accessoryButtonTappedForCell: (UITableViewCell *) cell;
@end
CustomAccessoryViewTableCell.h
@interface CustomAccessoryViewTableCell : UITableViewCell
/** The custom accessory delegate. */
@property (nonatomic, weak) id<CustomAccessoryTableCellDelegate> delegate;
@end
CustomAccessoryViewTableCell.m
- (IBAction) buttonAction:(id)sender{
if ([self.delegate respondsToSelector:@selector(accessoryButtonTappedForCell:)]) {
[self.delegate accessoryButtonTappedForCell:self];
}
}
Inside Table View Controller
- (UITableViewCell *)tableView:(UITableView *)tableView
cellForRowAtIndexPath:(NSIndexPath *)indexPath{
CustomAccessoryViewTableCell *cell = [tableView
dequeueReusableCellWithIdentifier:@"MyCustomCell"];
cell.label.text = @"Some Name";
cell.delegate = self;
return cell;
}
#pragma mark - Custom Accessory View Delegate
- (void) accessoryButtonTappedForCell:(UITableViewCell *)cell{
[self tableView:self.writerTable
accessoryButtonTappedForRowWithIndexPath: [self.writerTable
indexPathForCell:cell]];
}