How to forward UITableViewDelegate methods?
I have created property in "CETableViewBindingHelper.h" file.
@property (weak, nonatomic) id
Now how to use this delegate to forward "didSelectRowAtIndexPath" method to view controller?
I have implemented below code in "CETableViewBindingHelper.m" file.
#pragma mark = UITableViewDelegate methods
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {
// execute the command
[_selection execute:_data[indexPath.row]];
// forward the delegate method
if ([self.delegate respondsToSelector:@selector(tableView:didSelectRowAtIndexPath:)]) {
[self.delegate tableView:tableView didSelectRowAtIndexPath:indexPath];
}
}
But "[self.delegate tableView:tableView didSelectRowAtIndexPath:indexPath];" this line is not executed.
Can you please help me that how can I forward any tableview delegate methods in my ViewController.
Forwarding this method should already happen via the code here:
https://github.com/ColinEberhardt/CETableViewBinding/blob/f9981da4bb2359f62a0438c3df6fb3e30c500abe/CETableViewBindingHelper.m#L330
Are you using the latest version of the code?
Ohh sorry I updated my code and its working fine.
Thanks for help.
Nice one - glad it works now.