美文网首页
tableViewCell 插入

tableViewCell 插入

作者: RockStar_阿俊 | 来源:发表于2016-06-11 22:12 被阅读0次

-(void)addRows{

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

   NSIndexPath *indexPath = [NSIndexPath indexPathForRow:0 inSection:0];

  [indexPaths addObject: indexPath];

//这个位置应该在修改tableView之前将数据源先进行修改,否则会崩溃........必须向tableView的数据源数组中相应的添加一条数据

  [self.tableView beginUpdates];

  [self.tableView insertRowsAtIndexPaths:indexPathswithRowAnimation:UITableViewRowAnimationLeft];

  [self.tableView endUpdates];

}

相关文章

网友评论

      本文标题:tableViewCell 插入

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