Skip to content

Instantly share code, notes, and snippets.

Created April 8, 2014 18:54
Show Gist options
  • Save anonymous/10170966 to your computer and use it in GitHub Desktop.
Save anonymous/10170966 to your computer and use it in GitHub Desktop.
Order of Operations Matter
NSInteger assetCount = [group numberOfAssets];
if(assetCount <= 0){
return;
}
[group setAssetsFilter:[ALAssetsFilter allPhotos]];
NSIndexSet *indexes = [NSIndexSet indexSetWithIndex:assetCount-1];
// instead of this:
[group setAssetsFilter:[ALAssetsFilter allPhotos]];
NSInteger assetCount = [group numberOfAssets];
if(assetCount <= 0){
return;
}
NSIndexSet *indexes = [NSIndexSet indexSetWithIndex:assetCount-1];
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment