等到UITableView完成reloadData [英] wait till UITableView finish reloadData

查看:75
本文介绍了等到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的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆