Created
November 26, 2014 09:23
-
-
Save mikeabdullah/41a27573a6092f1bf0f9 to your computer and use it in GitHub Desktop.
Connecting cell to controller by responder chain
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@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