Create a gist now

Instantly share code, notes, and snippets.

What would you like to do?
Connecting in-cell button direct to view controller
@implementation MyTableViewController
- (IBAction)checkboxPressed:(UIButton *)button {
// Figure out which row this checkbox belongs to
id aView = button.superview;
while (![aView isKindOfClass:UITableViewCell.class]) {
aView = [aView superview];
}
NSIndexPath *row = [self.tableView indexPathForCell:aView];
// Now can look up the task at that row and work with it
}
@end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment