I am using a NIB file to layout a custom table view cell. This cell has a label with outlet called lblName. Adding a UITapGestureRecognizer to this label never fires the assoc
Once you assign the tap gesture to the UILabel and set the user interaction to enabled, in your callback function you can find the indexpath from the cell view but searching through the nest of superviews:
- (UITableViewCell *) findCellInSuperview:(UIView *)view
{
UITableViewCell *cell = nil;
NSString *className = NSStringFromClass([[view superview] class]);
if ([className isEqualToString:@"UITableViewCell"]) {
cell = (UITableViewCell *)[view superview];
} else {
if ([view superview] != nil) {
cell = [self findCellInSuperview:[view superview]];
}
}
return cell;
}