iOS学习笔记9 tableview的数据添加与删除

[self.tableview.reloadData];

//要有动画就调用下面方法
[self.tableview insertRowsAtIndexPath:@[NSIndexPath indexPathForRow:0 inSection:0]....]
//或者delete开头的方法

数据刷新原则

  • 修改模型数据
  • 调用数据刷新方法
  • 不要直接修改cell属性

图片拉伸处理

  // 拉伸处理(说明需要保护的区域)
//瓦片平铺
 image = [image resizableImageWithCapInsets:UIEdgeInsetsMake(30, 30, 30, 30) resizingMode:UIImageResizingModeStretch];
 // 
image = [image stretchableImageWithLeftCapWidth:image.size.width * 0.5 topCapHeight:image.size.height * 0.5];

你可能感兴趣的:(iOS学习笔记9 tableview的数据添加与删除)