美文网首页
刷新单个cell 和 刷新单个 section

刷新单个cell 和 刷新单个 section

作者: 在下有双 | 来源:发表于2018-08-20 10:55 被阅读0次
/**
 *  单个cell的刷新
 */
//1.当前所要刷新的cell,传入要刷新的 行数 和 组数
NSIndexPath *indexPath = [NSIndexPath indexPathForRow:0 inSection:0];
//2.将indexPath添加到数组
NSArray <NSIndexPath *> *indexPathArray = @[indexPath];
//3.传入数组,对当前cell进行刷新
[tableView reloadRowsAtIndexPaths:indexPathArray withRowAnimation:UITableViewRowAnimationAutomatic];

/**
 *  单个Section的刷新
 */
//1.传入要刷新的组数
NSIndexSet *indexSet=[[NSIndexSet alloc] initWithIndex:0];
//2.传入NSIndexSet进行刷新
[tableView reloadSections:indexSet withRowAnimation:UITableViewRowAnimationAutomatic];

相关文章

网友评论

      本文标题:刷新单个cell 和 刷新单个 section

      本文链接:https://www.haomeiwen.com/subject/urukiftx.html