Fix crash while deleting multiple sections

This commit is contained in:
Li Tan
2014-12-16 20:03:28 -08:00
parent 282151d653
commit ac86cd9523
2 changed files with 2 additions and 8 deletions

View File

@@ -47,7 +47,7 @@ static const CGFloat kASFlowLayoutControllerRefreshingThreshold = 0.3;
}
- (void)deleteNodesAtIndexPaths:(NSArray *)indexPaths {
[indexPaths enumerateObjectsUsingBlock:^(NSIndexPath *indexPath, NSUInteger idx, BOOL *stop) {
[indexPaths enumerateObjectsWithOptions:NSEnumerationReverse usingBlock:^(NSIndexPath *indexPath, NSUInteger idx, BOOL *stop) {
std::vector<CGSize> &v = _nodeSizes[indexPath.section];
v.erase(v.begin() + indexPath.row);
}];