简体   繁体   中英

How do I display the images in a custom album in my iOS App

I have created a custom album with using the below code

(void)imagePickerController:(UIImagePickerController *)picker didFinishPickingMediaWithInfo:(NSDictionary *)info
{
    <--other code stuffs here-->
    <--selectedImage is the UIImage from Camera or from gallery-->

    [self.library saveImage:selectedImage toAlbum:@"My Album" withCompletionBlock:^(NSError *error)
    {
        if (error!=nil)
        {
            NSLog(@"Big error: %@", [error description]);
        }
    }];
    <--other code stuffs here-->
}

Now I want to display these saved images in my application.

How do I access these images, and create a gallery in my APP.

Thanks,

Sujith

The method you want is the ALAssetsLibrary method addAssetsGroupAlbumWithName:resultBlock:failureBlock: which is detailed in the docs here: http://developer.apple.com/library/ios/#documentation/AssetsLibrary/Reference/ALAssetsLibrary_Class/Reference/Reference.html#//apple_ref/occ/cl/ALAssetsLibrary

It was introduced in iOS 5 and has not since been deprecated, so I'm not quite sure what the issue is if it's not working for you. You may have to update or repost the question if you are having trouble with it.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM