问题描述
我在使用 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:第一次点击时没有被调用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!