1

我有一个UITableView与一个大细胞和许多小细胞。当我从服务器接收内容时,我用功能- (BOOL)performFetch:(NSError **)errorNSFetchedResultsController)更新我的UITableView。我注意到我的大单元在更新后有dublicate,第二个单元没有重新加载。当我向下滚动并滚动到顶部桌子看起来不错。 我该如何解决我的问题?如何更新表格视图单元格?

enter image description here

+0

尝试[tableView reloadData]; – 2014-09-19 08:34:12

+0

@MerleaDan,如果我用[tableView reloadData]更新表;我没有排列动画 – Sveta 2014-09-19 08:35:02

回答

1

“performFetch” 更新数据源,但实现代码如下本身不会被更新。

对于更新的tableview兼用

- (void)reloadRowsAtIndexPaths:(NSArray *)indexPaths 
       withRowAnimation:(UITableViewRowAnimation)animation 

- (void)reloadSections:(NSIndexSet *)sections 
     withRowAnimation:(UITableViewRowAnimation)animation 

你可以选择你最喜欢的动画,例如UITableViewRowAnimationMiddle或只是UITableViewRowAnimationAutomatic

出于性能方面的更新只非常必要。

相关问题