Currently I am doing the following to iterate on a NSMutableIndexSet:
if ([indexSet isNotNull] && [indexSet count] > 0){
__weak PNRHighlightViewController *weakSelf = self;
[indexSet enumerateIndexesUsingBlock:^(NSUInteger idx, BOOL *stop) {
if ([[self.highlightedItems_ objectAtIndex:idx] isNotNull]){
NSIndexPath *indexPath = [NSIndexPath indexPathForRow:idx inSection: [weakSelf.collectionView numberOfSections]-1];
[weakSelf.collectionView reloadItemsAtIndexPaths:[NSArray arrayWithObject:indexPath]];
}
}];
}
I wanted to generate a NSIndexPath array and then reload the whole collectionView at those index paths. So basically I want to call the reload after the block is complete. How can I do so?
One way to do this would be,