简体   繁体   English

reloadData 没有被调用

[英]reloadData not getting called

I am updating my table data resource and then I am calling我正在更新我的表数据资源,然后我打电话

[self.tableView reloadData] [self.tableView reloadData]

to load the table view with this new data.用这个新数据加载表视图。 This is all happening in a thread.这一切都发生在一个线程中。 Now, it works fine with lets say I add 4-5 objects but at some point it stops calling the cellForRowAtIndexPath to reload the table with new data.现在,它可以正常工作,假设我添加了 4-5 个对象,但在某些时候它会停止调用 cellForRowAtIndexPath 以使用新数据重新加载表。

Data source is getting updated all the time to contain latest data.数据源一直在更新以包含最新数据。 So, data source has 10 objects but I can see only 5 on the screen.因此,数据源有 10 个对象,但我只能在屏幕上看到 5 个。 And it keeps on adding the data but do not show it.它继续添加数据但不显示它。 Breakpoint shows the call to reloadData is not invoking cellForRowAtIndexPath after that.断点显示对 reloadData 的调用在此之后没有调用 cellForRowAtIndexPath。

What could be the reason.可能是什么原因。

hunch: make sure you message UIKit objects from the main thread (exclusively).预感:确保您从主线程(仅)向 UIKit 对象发送消息。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM