我正在尝试向我的 tableView 添加行,如下所示:
[myArray addObject:@"Apple"];
[myTableView beginUpdates];
[myTableView insertRowsAtIndexPaths:[NSArray arrayWithObject:[NSIndexPath indexPathForRow:0 inSection:0]] withRowAnimation:UITableViewRowAnimationTop];
[myTableView endUpdates];
问题是单元格没有被刷新。textLabels 不对应于数据源数组。
我通过添加解决问题:
[myTableView reloadData];
但这会使漂亮的插入动画消失。
想法?谢谢!