代码之家  ›  专栏  ›  技术社区  ›  Michael Grinich

UITableView-添加单元格

  •  2
  • Michael Grinich  · 技术社区  · 17 年前

    打电话:

    [self.tableView reloadData]
    

    将重新加载现有单元格中的内容,但我需要为新数据添加单元格。此方法似乎没有调用

    -tableView:tableView numberOfRowsInSection:section
    

    谢谢!

    1 回复  |  直到 17 年前
        1
  •  6
  •   Ed Marty    17 年前

    看看UITableView中的这些函数:

    -(void)insertSections:(NSIndexSet *)sections withRowAnimation:(UITableViewRowAnimation)animation
    -(void)insertRowsAtIndexPaths:(NSArray *)indexPaths withRowAnimation:(UITableViewRowAnimation)animation