diff --git a/AsyncDisplayKit/Details/ASCollectionDataController.mm b/AsyncDisplayKit/Details/ASCollectionDataController.mm index b264102a9f..ba1647a282 100644 --- a/AsyncDisplayKit/Details/ASCollectionDataController.mm +++ b/AsyncDisplayKit/Details/ASCollectionDataController.mm @@ -89,7 +89,9 @@ - (void)willInsertSections:(NSIndexSet *)sections { - [_pendingContexts enumerateKeysAndObjectsUsingBlock:^(NSString *kind, NSMutableArray *contexts, BOOL *stop) { + NSArray *keys = _pendingContexts.allKeys; + for (NSString *kind in keys) { + NSMutableArray *contexts = _pendingContexts[kind]; NSMutableArray *sectionArray = [NSMutableArray arrayWithCapacity:sections.count]; for (NSUInteger i = 0; i < sections.count; i++) { [sectionArray addObject:[NSMutableArray array]]; @@ -100,7 +102,7 @@ [self insertNodes:nodes ofKind:kind atIndexPaths:indexPaths completion:nil]; }]; [_pendingContexts removeObjectForKey:kind]; - }]; + } } - (void)willDeleteSections:(NSIndexSet *)sections @@ -124,7 +126,9 @@ - (void)willReloadSections:(NSIndexSet *)sections { - [_pendingContexts enumerateKeysAndObjectsUsingBlock:^(NSString *kind, NSMutableArray *contexts, BOOL *stop) { + NSArray *keys = _pendingContexts.allKeys; + for (NSString *kind in keys) { + NSMutableArray *contexts = _pendingContexts[kind]; NSArray *indexPaths = ASIndexPathsForMultidimensionalArrayAtIndexSet([self editingNodesOfKind:kind], sections); [self deleteNodesOfKind:kind atIndexPaths:indexPaths completion:nil]; // reinsert the elements @@ -132,7 +136,7 @@ [self insertNodes:nodes ofKind:kind atIndexPaths:indexPaths completion:nil]; }]; [_pendingContexts removeObjectForKey:kind]; - }]; + } } - (void)willMoveSection:(NSInteger)section toSection:(NSInteger)newSection