iOS _ 获取指定的UITableViewCell 并刷新

来源:互联网 发布:lightroom是什么软件 编辑:程序博客网 时间:2024/05/16 05:03

开发中遇到需要对指定的UITableViewCell进行操作,翻阅了一些资料,经核实确实能解决这个问题,便拿出来与大家分享一下.

//  1, 需要对指定一个section进行刷新    NSIndexSet *indexSet=[[NSIndexSet alloc]initWithIndex:1];    [tableview reloadSections:indexSet withRowAnimation:UITableViewRowAnimationAutomatic];    //  2,需要对指定 一个cell刷新    NSIndexPath *indexPath=[NSIndexPath indexPathForRow:4 inSection:0];    [tableView reloadRowsAtIndexPaths:[NSArray arrayWithObjects:indexPath,nil] withRowAnimation:UITableViewRowAnimationNone];  

使用方法:
对需要刷新的Section或者Cell更换数据源,然后使用此方法进行刷新,可减少数据请求.

0 0
原创粉丝点击