Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

indexPath in didSelectRowAtIndexPath #30

Open
nyeu opened this issue Jun 22, 2015 · 7 comments
Open

indexPath in didSelectRowAtIndexPath #30

nyeu opened this issue Jun 22, 2015 · 7 comments

Comments

@nyeu
Copy link

nyeu commented Jun 22, 2015

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
Copy link
Author

nyeu commented Jun 22, 2015

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

@Krelborn
Copy link
Owner

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.

@nyeu
Copy link
Author

nyeu commented Jun 23, 2015

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.

@vgolovnev
Copy link

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

@dayj
Copy link

dayj commented Aug 28, 2015

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.

@fealonelei
Copy link

@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.

@LinkRober
Copy link

Thanks @dayj

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants