Hi, i came across the following piece of code which loads everything from photo album but what should i do if i only wanted to load the video type in the photo album on a table?
thanks in advance.
void (^assetEnumerator)(struct ALAsset *,NSUInteger, BOOL *) = ^(ALAsset *result, NSUInteger index, BOOL *stop){ if(result != nil){ NSLog(@"Asset:%@", result); [Asset addObject:result]; } };
void (^assetGroupEnumerator)(struct ALAssetsGroup *, BOOL *) = ^(ALAssetsGroup *group, BOOL *stop){
if(group != nil){
[group enumerateAssetsUsingBlock: assetEnumerator];
}
[self.tableView reloadData];
};
Asset = [[NSMutableArray alloc] init];
ALAssetsLibrary *Library = [[ALAssetsLibrary alloc] init];
[Library enumerateGroupsWithTypes:ALAssetsGroupAlbum
usingBlock:assetGroupEnumerator
failureBlock:^(NSError *error){
NSLog(@"error occurred");
}];