【发布时间】:2015-07-05 10:11:31
【问题描述】:
我有一个问题,我有一个 UITableViewController,当视图出现时,我会异步执行一些计算,这会导致更新表中的特定行。
在 cellStartEditing 函数中,我计算了需要更新的必要行,如下所示:
-(void) cellStartEditing:(templateRow *) row{
int Cellowid= row.rowId;
[arrQuestions removeObjectAtIndex:CellRowid];
[arrQuestions insertObject:row atIndex:CellRowid];
NSIndexPath *indexPath = [NSIndexPath indexPathForRow: inSection:0];
[tvQuestion reloadRowsAtIndexPaths:@[indexPath] withRowAnimation:UITableViewRowAnimationNone];
}
当时 reloadRowsAtIndexPaths 动画获得 50% CPU 内存?
【问题讨论】:
-
这个方法是不是不小心被多次调用了?
-
只有一次单击单元格索引时..
-
如果你提供
cellForRowAtIndexPath方法代码,那就更清楚了,为什么会这样。 -
[tvQuestion cellForRowAtIndexPath:indexPath];但表不会在索引处重新加载。
标签: ios iphone uitableview uiviewanimation nsindexpath