我在我的应用程序使用的代码保存的照片我的自定义相册
[library saveImage:self.capturedImg toAlbum:@"FunCam" withCompletionBlock:^(NSError *error) {
if (error!=nil) {
NSLog(@"Big error: %@", [error description]);
}
}];
现在我想以检索保存到相册中的所有照片时,用户点击一些按钮,并显示在图像相机应用(iPhone上的默认应用)节目
请帮帮我,我该怎么办呢?
提前致谢
试试这些方法...
-(void)loadNewLibraryImages
{
self.assetGroups = [[NSMutableArray alloc] init];
// Group enumerator Block
dispatch_async(dispatch_get_main_queue(), ^
{
void (^assetGroupEnumerator)(struct ALAssetsGroup *, BOOL *) = ^(ALAssetsGroup *group, BOOL *stop)
{
if (group == nil)
{
return;
}
if ([[group valueForProperty:ALAssetsGroupPropertyName] isEqualToString:@"YOUR ALBUM NAME"]) {
[self.assetGroups addObject:group];
[self loadImages];
return;
}
if (stop) {
return;
}
};
// Group Enumerator Failure Block
void (^assetGroupEnumberatorFailure)(NSError *) = ^(NSError *error) {
UIAlertView * alert = [[UIAlertView alloc] initWithTitle:@"ERROR" message:[NSString stringWithFormat:@"No Albums Available"] delegate:nil cancelButtonTitle:@"Ok" otherButtonTitles:nil];
[alert show];
[alert release];
};
// Enumerate Albums
ALAssetsLibrary *library = [[ALAssetsLibrary alloc] init];
[library enumerateGroupsWithTypes:ALAssetsGroupAll
usingBlock:assetGroupEnumerator
failureBlock:assetGroupEnumberatorFailure];
});
}
-(void)loadImages
{
//for (ALAssetsGroup *assetGroup in self.assetGroups) {
// for (int i = 0; i<[self.assetGroups count]; i++) {
ALAssetsGroup *assetGroup = [self.assetGroups objectAtIndex:0];
NSLog(@"ALBUM NAME:;%@",[assetGroup valueForProperty:ALAssetsGroupPropertyName]);
[assetGroup enumerateAssetsUsingBlock:^(ALAsset *result, NSUInteger index, BOOL *stop)
{
if(result == nil)
{
return;
}
UIImage *img = [UIImage imageWithCGImage:[[result defaultRepresentation] fullScreenImage] scale:1.0 orientation:(UIImageOrientation)[[result valueForProperty:@"ALAssetPropertyOrientation"] intValue]];
}];
// }
}
希望他们能帮助....