如何在不重新加载完整表的情况下更新UITableVIewCell

New*_*bee 17 iphone objective-c uitableview ios

可能重复:
是否可以在UITableView中刷新单个UITableViewCell?

在一个序列中,我只更新列表数据中的特定对象(NSMUtableArray),一旦更新了它的值,为了进行GUI更新,我重新加载了如下所示的完整表...

[table reloadData];
Run Code Online (Sandbox Code Playgroud)

它工作正常,但在效率方面,它在我滚动时有点悬挂,有没有办法只更新一个特定的单元格而不重新加载全表?

谢谢.

ama*_*mar 31

 - (void)reloadRowsAtIndexPaths:(NSArray *)indexPaths withRowAnimation:(UITableViewRowAnimation)animation;
Run Code Online (Sandbox Code Playgroud)

用这个

  • 对他们使用延迟加载 (2认同)

Sco*_*ive 9

你可以用这个..

NSArray *indexPathArray = [NSArray arrayWithObject:[NSIndexPath indexPathForRow:1 inSection:0]];
//You can add one or more indexPath in this array...

[tblview reloadRowsAtIndexPaths:indexPathArray withRowAnimation:UITableViewRowAnimationFade];
Run Code Online (Sandbox Code Playgroud)