大家好,需要实现代码遍历 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]];
}
}];
}
我想生成NSIndexPath
数组,然后重新加载指定指针路径的collectionView,也就是block完成之后调用重新加载,不知道怎么实现?