简体   繁体   English

ReloadData不会触发tableView:numberOfRowsInSection:

[英]ReloadData doesn't fire tableView:numberOfRowsInSection:

I just encouter a problem, that I call UITableView reloadData method, but nothing happened. 我只是遇到一个问题,我叫UITableView reloadData方法,但是什么也没发生。 No tableView:numberOfRowsInSection is called. 没有调用tableView:numberOfRowsInSection。

The scenario is: 该方案是:

Table works fine in view A (has the UITableView), then view B shows and hide, after this step, the UITableView reloadData is not working anymore. 表工作在视图中的细(具有的UITableView),然后查看B所示,并隐藏,此步骤之后,UITableView的reloadData不工作了。 I am sure reloadData is called in main UI thread and the data source has been changed. 我确定在主UI线程中调用了reloadData并且数据源已更改。 Also NO IBOutlet connection issue. 也没有IBOutlet连接问题。

尝试将对reloadData的调用放在viewWillAppear中。

Set BreakPoint on [tableView reloadData]; 在[tableView reloadData]上设置BreakPoint; check that your tableView object is not nil. 检查您的tableView对象不是nil。

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

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