Skip to content

Instantly share code, notes, and snippets.

@mikeabdullah
Created November 26, 2014 09:23
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mikeabdullah/41a27573a6092f1bf0f9 to your computer and use it in GitHub Desktop.
Save mikeabdullah/41a27573a6092f1bf0f9 to your computer and use it in GitHub Desktop.
Connecting cell to controller by responder chain
@implementation MyTableViewCell
- (IBAction)checkboxPressed:(UIButton *)checkbox event:(UIEvent *)event {
// Send onwards up the responder chain with the cell as sender
[UIApplication.sharedApplication sendAction:@selector(cellCheckboxPressed:)
to:nil
from:self
event:event];
}
@end
@implementation MyTableViewController
- (void)cellCheckboxPressed:(MyTableViewCell *)cell {
// Look up task and work with it
}
@end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment