0
我有自定義的UITableView和UIImageView,UILabel。在某些通知上,我只需要更新UILabel而不是UIImageView。如果我這樣做:UITableViewCell自定義,更新UILabel
[self.tableView reloadRowsAtIndexPaths:[NSArray arrayWithObject:[NSIndexPath indexPathForRow:idxCell inSection:0]] withRowAnimation:UITableViewRowAnimationFade];
單元格的所有內容都在更新,我對UIImageView有閃爍效果。 我做這樣的:
MyTableViewCell *cell = (MyTableViewCell *)[self.tableView cellForRowAtIndexPath:[NSIndexPath indexPathForRow:idx inSection:0]];
cell.counterLabel.text = [NSString stringWithFormat:@"%@", counter];
但我認爲,這是不好的,因爲它是不對應於MVC模式。我想我應該更新我的模型對象。我需要建議,我該如何做到這一點?