I implemented a simple method that found the path to images inside the device. I actually use the iPhone Simulator. This is the code I'm using:
[library enumerateGroupsWithTypes:ALAssetsGroupAll usingBlock:^(ALAssetsGroup *group, BOOL *stop) { if (group) { [group setAssetsFilter:[ALAssetsFilter allPhotos]]; [group enumerateAssetsUsingBlock:^(ALAsset *asset, NSUInteger index, BOOL *stop){ if (asset){ NSString *description = [asset description]; NSRange first = [description rangeOfString:@"URLs:"]; NSRange second = [description rangeOfString:@"?id="]; NSString *path = [description substringWithRange: NSMakeRange(first.location + first.length, second.location - (first.location + first.length))]; [idList addObject:path]; } }]; } } failureBlock:^(NSError *error) { NSLog(@"error enumerating AssetLibrary groups %@\n", error); } ]; });
At this point, if I write down the path to the images, I get this: "assets-library: //asset/asset.JPG", which for what I know is not the whole path with the exact location of the image. Are you okay? So how can I get all the way to the resource?
thanks
source share