Is there a way to get NSURL of all the images in iphone without using ALAsset
I am new to iphone - objC et al. I wanted to know if there is a way by which I could get all the NSURL and filename of the images files in an iphone without making use of ALAsset ?
In the current code - it is done like below. And I see the time it takes to loop 1100 images is like 14 seconds. Is there a better way to get url,filename quickly, please let me know.
ALAssetsLibrary* assetLibrary = [[ALAssetsLibrary alloc] init]; ALAssetsGroupType type = m == 2 || m == 1 ? ALAssetsGroupAll : ALAssetsGroupLibrary; [assetLibrary enumerateGroupsWithTypes:type usingBlock:^(ALAssetsGroup* group, BOOL* stop) { if (group) { [group setAssetsFilter:m == 1 ? [ALAssetsFilter allVideos] : [ALAssetsFilter allPhotos]]; [group enumerateAssetsUsingBlock:^(ALAsset* asset, NSUInteger index, BOOL* innerstop) { if (asset) { @autoreleasepool { if (!initialized) { *innerstop = YES; return; } /***************************************************************************************/ ALAssetRepresentation* defaultRepresentation = [asset defaultRepresentation]; if(defaultRepresentation) { //NSLog(@"defaultRepresentation for %@", [[defaultRepresentation url] absoluteString]); long long size = [defaultRepresentation size]; NSURL* url = [defaultRepresentation url]; NSString* fileName = [defaultRepresentation filename];