Use ALAssests! For example...
Update: 04/27/14
- (void)loadImageFromIndex:(int)index withAssetLibrary:(ALAssetsLibrary*)library {
[library enumerateGroupsWithTypes:ALAssetsGroupSavedPhotos usingBlock:^(ALAssetsGroup *group, BOOL *stop) {
// Within the group enumeration block, filter to enumerate your photos.
[group setAssetsFilter:[ALAssetsFilter allPhotos]];
//if index exceeds bounds, kill the method
if (index < 0 || index > [group numberOfAssets]-1) {
return;
}
// Chooses the photo at the index
[group enumerateAssetsAtIndexes:[NSIndexSet indexSetWithIndex:index] options:0 usingBlock:^(ALAsset *alAsset, NSUInteger inde, BOOL *innerStop) {
// The end of the enumeration is signaled by asset == nil.
if (alAsset) {
ALAssetRepresentation *representation = [alAsset defaultRepresentation];
UIImage *tempImage = [UIImage imageWithCGImage:[representation fullScreenImage]];
// Do something with the image
}
}];
}
failureBlock: ^(NSError *error) {
NSLog(@"None");
}];
}