UITableView didSelectRowAtIndexPath:第一次点击时没有被调用 [英] UITableView didSelectRowAtIndexPath: not being called on first tap

查看:35
本文介绍了UITableView didSelectRowAtIndexPath:第一次点击时没有被调用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在使用 UITableView 的 didSelectRowAtIndexPath 时遇到问题.

I'm having an issue with UITableView's didSelectRowAtIndexPath.

我的表已设置,因此当我选择行时,它会初始化一个新的视图控制器并推送它.

My table is setup so that when I select row it initializes a new view controller and pushes it.

我第一次点击表格中的任何行时,该方法不会被调用.一旦我选择另一行,它就会开始正常工作.

The first time I tap any row in the table, the method does not get called. Once I select another row, it begins to work as normal.

我已经通过在 didSelectRowAtIndexPath 上设置断点来验证这一点.在向方法中添加 NSLog 时,我看到当我选择最终推送新视图控制器的第二行时,我看到控制台中同时出现了两条日志语句.

I have verified this by setting a breakpoint on didSelectRowAtIndexPath. When adding an NSLog to the method I see that when I select the second row that finally pushes the new view controller, I see two log statements appear in the console at the same time.

有什么建议吗?

推荐答案

有没有可能你不小心输入了DeselectRowAtIndexPath?

Any chance you accidentally typed didDeselectRowAtIndexPath?

这篇关于UITableView didSelectRowAtIndexPath:第一次点击时没有被调用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆