How does one implement a raw callback in objective C?
I just want to notify a ViewController when one of my UITableViewCell objects(custom cell) detects touch.
I need to notify my RootViewController so that it can create an object of another ViewController and push it on the navigation stack.
You can use a custom init method like below for secondVC and store the _sender in global or class variable. like
- (id)initWithSender:(id)_sender { self = [super init]; if (self) { sender=_sender; } return self; }from RootVC initialize secondvc as follows and define a method named -(void) touchDetected; in rootvc.
secondvc=[[SecondVC alloc] initWithSender:self]; [[self navigationController] pushViewController: secondvc animated:YES];when the touch is detected in secondvc call, this will notify your rootvc that the touch is detected in secondvc.