Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/objective-c/27.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Ios UITableView cellForRowAtIndexPath的调用顺序错误_Ios_Objective C_Uitableview - Fatal编程技术网

Ios UITableView cellForRowAtIndexPath的调用顺序错误

Ios UITableView cellForRowAtIndexPath的调用顺序错误,ios,objective-c,uitableview,Ios,Objective C,Uitableview,我有一个UITableView,我面临的一个问题是,有时cellforrowatinexpath的调用顺序错误 我们在一个表中有6行和一个部分cellforrowatinexpath。因此,当表格加载时,它会在顶部显示第三行。现在,当我向下滚动时,cellForRowAtIndexPath再次被(0,1)和(0,0)调用,表格跳转并在顶部显示行0 更新:似乎实现了heightForRowAtIndexPath委托,并且错误地为every indexPath返回了零。尽管移除它解决了这个问题,但它

我有一个
UITableView
,我面临的一个问题是,有时
cellforrowatinexpath
的调用顺序错误

我们在一个表中有6行和一个部分<按
(0,2)、(0,3)、(0,4)、(0,5)
的顺序调用code>cellforrowatinexpath。因此,当表格加载时,它会在顶部显示第三行。现在,当我向下滚动时,
cellForRowAtIndexPath
再次被
(0,1)
(0,0)
调用,表格跳转并在顶部显示行0


更新:似乎实现了heightForRowAtIndexPath委托,并且错误地为every indexPath返回了零。尽管移除它解决了这个问题,但它为什么从(0,2)开始仍然是个谜。任何逻辑解释?

似乎实现了heightForRowAtIndexPath委托,并且为every indexPath返回了零。虽然删除它解决了这个问题,但谜团仍然是为什么它在(0,2)处启动indexPath

您可以共享代码吗?发布您的代码。此索引路径包含可见的单元格。当单元格变为可见时,将在此委托中接收其indexpath。当您滚动表格视图时,请尝试观察。代码太大,无法粘贴,但您能否指出cellForRowAtIndexPath不应从第0行开始并跳到第2行的原因。@Yusuf显示您的UI行为视频。