objective-c - 等到 UITableView 完成 reloadData

标签 objective-c multithreading uitableview tableview

<分区>

Possible Duplicate:
Get notified when UITableView has finished asking for data?

是否可以在 tableview 完成 reloadData 方法后重新加载其数据时收到通知?或者是否可以等到 tableview 完成重新加载?

谢谢

最佳答案

有一个非常简单的解决方案是检查你是否在委托(delegate)的最后一次迭代中

-(void) tableView:(UITableView *)tableView willDisplayCell:(UITableViewCell *)cell forRowAtIndexPath:(NSIndexPath *)indexPath 

最后一次迭代完成后,最后添加你的代码

-(void) tableView:(UITableView *)tableView willDisplayCell:(UITableViewCell *)cell forRowAtIndexPath:(NSIndexPath *)indexPath
{
    if([indexPath row] == lastRow){
          any code you want

    }
}

谢谢

关于objective-c - 等到 UITableView 完成 reloadData,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/6490884/

相关文章:

iphone - 将 Long Long 数除以百分比

iphone - NSString UTF8String 修改 unicode 字符

c - 按顺序从线程写入位序列

objective-c - UITableView 不重新加载内容

objective-c - 点击键盘上方移动文本字段的逻辑

Objective-C - CABasicAnimation 在动画后应用更改?

java - LinkedBlockingQueue unbounded 和 LinkedBlockingQueue with capacity 哪个更好

c++ - 在没有游戏引擎/渲染窗口的情况下将游戏服务器线程循环限制为 30FPS

objective-c - 在 UITableviewCell 高度动画的同时动画 CALayer 阴影

ios - 如何使用 Firebase 在 UITableViewController 中正确显示数据?