好久没写了,来点儿基础的,开发中避免不了数据刷新,一般用[self.tableView reloadData];就可以搞定
但有时只需要刷新指定的某一组或某一行
//某个section刷新
NSIndexSet *indexSet = [[NSIndexSet alloc] initWithIndex:2];
[tableview reloadSections:indexSet withRowAnimation:UITableViewRowAnimationA
utomatic];
//某个cell刷新
NSIndexPath *indexPath = [NSIndexPath indexPathForRow:1 inSection:0];
[tableView reloadRowsAtIndexPaths:[NSArray arrayWithObjects:indexPath,nil] withRowAnimation:UITableViewRowAnimationNone];