KILabel icon indicating copy to clipboard operation
KILabel copied to clipboard

indexPath in didSelectRowAtIndexPath

Open nyeu opened this issue 9 years ago • 7 comments

I have a tableview where cells display a KILabel, when I tapped a cell (not the kilabel link), I get the wrong indexpath, I get the previous indexPath selected. If I remove the kilabel, everything works like a charm.

nyeu avatar Jun 22 '15 09:06 nyeu

The way to "solve" the issue is adding [tableView reloadData] at the end of didSelectRowAtIndexPath.

nyeu avatar Jun 22 '15 09:06 nyeu

That doesn't sound right. You really don't want to be reloading the table data after making a selection.

Have you looked at the demo project to see how to use it in a table. I can't imagine why using KILabel would affect selection of table cells.

Krelborn avatar Jun 22 '15 16:06 Krelborn

Yes, I know it doesn't sound right but it was the only way to get KILabel working. I looked at the demo project and all the examples available and all looks right. The thing is, if it was my mistake, why with the reloadData worked? It's a weird thing.

nyeu avatar Jun 23 '15 13:06 nyeu

I have exactly the same problem. It seems like a bug.

vgolovnev avatar Aug 02 '15 23:08 vgolovnev

I ran into this same issue. It has to do with the way touchesBegan/Moved/Ended/Cancelled have been implemented. I was able to resolve the issue by using a UITapGestureRecognizer in lieu of overriding the touch event methods.

dayj avatar Aug 28 '15 23:08 dayj

@nyeu @vgolovnev @Dayj
in ** - (void)touchesEnded:(NSSet )touches withEvent:(UIEvent *)event * method , line 705, perhaps, just comment out [super touchesBegan:touches withEvent:event]; or remove it. It will fix the problem and didSelectRowAtIndexPath works happy again.

fealonelei avatar Oct 19 '15 10:10 fealonelei

Thanks @dayj

LinkRober avatar Apr 13 '16 09:04 LinkRober