http://www.cocoachina.com/bbs/read.php?tid=263492
-(void)getAllPictures
{
mutableArray =[[NSMutableArray alloc]init];
library = [[ALAssetsLibrary alloc] init];
[library enumerateGroupsWithTypes:ALAssetsGroupAll usingBlock:^(ALAssetsGroup *group, BOOL *stop) {
if(group != nil) {
[group enumerateAssetsUsingBlock:^(ALAsset *result, NSUInteger index, BOOL *stop) {
if(result != nil) {
if([[result valueForProperty:ALAssetPropertyType] isEqualToString:ALAssetTypePhoto]) {
UIImage *image = [[UIImage alloc] initWithCGImage:[result thumbnail]];
[mutableArray addObject:image];
NSLog(@"%@",mutableArray);
}
}
}];
}
} failureBlock:^(NSError *error) {NSLog(@"There is an error");}];
}