zoukankan      html  css  js  c++  java
  • iOS_OC UITableView 知识点

    1.插入新的数据并显示

      -(void)insertTableView:(Model *)model {

          NSMutableArray *indexPaths = [[NSMutableArray alloc] init];

          NSIndexPath *indexPath = [NSIndexPath indexPathForRow:_dataSource.count inSection:0];  //创建新的NSIndexPath

          [indexPaths addObject:indexPath];  //增加到NSMutableArray中去

          [_dataSource addObject:model];    //UITableView 数据源更新数据

          [tableView insertRowsAtIndexPaths:indexPaths withRowAnimation:UITableViewRowAnimationAutomatic];  //将新的行增加到表中

          [tableView scrollToRowAtIndexPath:indexPath atScrollPosition:UITableViewScrollPositionBottom animated:YES];   //将表滑动到最后一行

      }

  • 相关阅读:
    selenium 难定位元素、时间插件
    列表生成式
    三元表达式
    监控日志
    非空即真
    深拷贝浅拷贝
    元组
    list字典嵌套
    2021
    布尔类型
  • 原文地址:https://www.cnblogs.com/lizhen24/p/6015508.html
Copyright © 2011-2022 走看看