Objective c 将NSRange设置为从高到低
我需要向Objective c 将NSRange设置为从高到低,objective-c,cocoa,objective-c-blocks,nsrange,Objective C,Cocoa,Objective C Blocks,Nsrange,我需要向assetLibrary提供一个NSRange,以便在用户照片库上运行。 我想从头开始 NSRange range; range.length=[group numberOfAssets]; NSIndexSet *set = [NSIndexSet indexSetWithIndexesInRange: range]; // ** i need to get a set to start from [group numberOfAssets] and down ! [gro
assetLibrary
提供一个NSRange
,以便在用户照片库上运行。
我想从头开始
NSRange range;
range.length=[group numberOfAssets];
NSIndexSet *set = [NSIndexSet indexSetWithIndexesInRange: range];
// ** i need to get a set to start from [group numberOfAssets] and down !
[group enumerateAssetsAtIndexes:set
options:0
usingBlock:^(ALAsset *result, NSUInteger index, BOOL *stop) {
UIImage *thumbnail = [UIImage imageWithCGImage:[result thumbnail]];
我找不到一个方法来给出一个从末尾开始的范围
NSRange range;
range.length=[group numberOfAssets];
NSIndexSet *set = [NSIndexSet indexSetWithIndexesInRange: range];
// ** i need to get a set to start from [group numberOfAssets] and down !
[group enumerateAssetsAtIndexes:set
options:0
usingBlock:^(ALAsset *result, NSUInteger index, BOOL *stop) {
UIImage *thumbnail = [UIImage imageWithCGImage:[result thumbnail]];
现在,我正在从0和更高级别获取图像,我需要相反的图像。尝试使用
NSEnumerationReverse
[group enumerateAssetsAtIndexes:set options:NSEnumerationReverse usingBlock:^(ALAsset *result, NSUInteger index, BOOL *stop) {
// Do something
}];