UITableView局部刷新 刷新單個cell或section
/*
* 單個cell的刷新
*/
//1.當前所要刷新的cell,傳入要刷新的 行數 和 組數
NSIndexPath *indexPath = [NSIndexPath indexPathForRow:0 inSection:0];
//2.將indexPath添加到數組
NSArray <NSIndexPath *> *indexPathArray = @[indexPath];
//3.傳入數組,對當前cell進行刷新
[tableView reloadRowsAtIndexPaths:indexPathArray withRowAnimation:UITableViewRowAnimationAutomatic];
/**
* 單個Section的刷新
*/
//1.傳入要刷新的組數
NSIndexSet *indexSet=[[NSIndexSet alloc] initWithIndex:0];
//2.傳入NSIndexSet進行刷新
[tableView reloadSections:indexSet withRowAnimation:UITableViewRowAnimationAutomatic];
修改分割線顏色
[tableView setSeparatorColor:[UIColor blueColor]];