當你開始下載和更新自定義單元格以顯示進度,節省indexPath某處您委派
在頭
:
實施
NSIndexPath *targetCellIP;
@property (nonatomic, retain)NSIndexPath *targetCellIP;
:
@synthesize targetCellIP;
// Somewhere where you update cell layout to show progress save it's indexPath
[self setTargetCellIP:....];
// After download is completed, remove cell from data model
[[dataModel objectAtIndex:[targetCellIP section]]
removeObjectAtIndex:[targetCellIP row]];
// Remove cell from table
[tableView deleteRowsAtIndexPaths:[NSArray arrayWithObject:targetCellIP]
withRowAnimation:UITableViewRowAnimationMiddle];
這方法將是好的,只有當你只有一個單元的進度是你想要刪除的時候,其他情況下,您可以將索引存儲在數組中,並在需要時可以使用它們。
或者,你可以將它保存在一個數組中,然後遍歷數組。只用一行甚至更多就完美地工作。 – Simon