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

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

相關問題