Question

I need to provide an NSRange to the assetLibrary to run on the user photo library. I want to start from the end .

I cant find a way to give a range that starts from the end .

 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]];

now i am getting the images from 0 and up, i need the opposite .

Was it helpful?

Solution

Try using NSEnumerationReverse

[group enumerateAssetsAtIndexes:set options:NSEnumerationReverse usingBlock:^(ALAsset *result, NSUInteger index, BOOL *stop) {
    // Do something
}];
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top