本文介绍了等到UITableView完成reloadData的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
可能重复: 在UITableView完成请求数据时得到通知吗?
Possible Duplicate: Get notified when UITableView has finished asking for data?
在reviewData方法之后,tableview完成重新加载其数据时是否可以获得通知?还是可以等到tableview完成重新加载?
is it possible to get notification when tableview finish to reload its data after reloadData method? Or is it possible to wait till tableview finish reloading?
谢谢
推荐答案有一个非常简单的解决方案是检查您是否在委托的最后一次迭代中
There is a very simple solution is to check if you are in the last iteration of the delegate
-(void) tableView:(UITableView *)tableView willDisplayCell:(UITableViewCell *)cell forRowAtIndexPath:(NSIndexPath *)indexPath最后一次迭代完成后,最后在其中添加代码
after last iteration finished in the end add your code there
-(void) tableView:(UITableView *)tableView willDisplayCell:(UITableViewCell *)cell forRowAtIndexPath:(NSIndexPath *)indexPath { if([indexPath row] == lastRow){ any code you want } }谢谢
更多推荐
等到UITableView完成reloadData
发布评论