IOS中TableView更新数据的步骤

来源:互联网 发布:mac系统word 编辑:程序博客网 时间:2024/06/04 19:39
tableview刷新数据分两步:
(1)先改模型数据;

(2)刷新表格;


2> 刷新表格(刷新界面)的方法
* 全局刷新(每一行都会重新刷新)
- (void)reloadData;


* 局部刷新(使用前提: 刷新前后, 模型数据的个数不变)
- (void)reloadRows:(NSArray *)indexPaths withRowAnimation:(UITableViewRowAnimation)animation;


* 局部删除(使用前提: 模型数据减少的个数 == indexPaths的长度)
- (void)deleteRowsAtIndexPaths:(NSArray *)indexPaths withRowAnimation:(UITableViewRowAnimation)animation;

0 0