在我看的时候如何重新加载UITableView [英] How to Reload a UITableView While I am Looking at It

查看:103
本文介绍了在我看的时候如何重新加载UITableView的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当我将UITableView作为可见视图控制器的一部分时,如何重新加载它以便我正在查看的数据会更改为新数据。在我滚动它之前,只是调用reload似乎没有刷新数据。

When I have a UITableView as part of the visible view controller, how can I reload it so that the data I am looking at changes to the new data. Just calling reload doesn't seem to refresh the data until I scroll it.

推荐答案

调用 reloadData 方法在调用方法后立即刷新数据。它不等待表格滚动。在调用 reloadData 之前,请确保更改数据源(数组或字典或保存值的位置)。

Calling the reloadData method refreshes the data as soon as the method is called. It does not wait for the table to be scrolled. Make sure the data source (array or dictionary or wherever you've saved the values) is changed before you call reloadData.

这篇关于在我看的时候如何重新加载UITableView的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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