简体   繁体   English

是否可以将图像仅保存到iOS6中的自定义相册?

[英]Is it possible to save an image ONLY to a custom album in iOS6?

I want to save a image captured with AVCaptureStillimageOutput and I'm trying to save it using this code : 我想保存用AVCaptureStillimageOutput捕获的图像,并且尝试使用以下代码保存它:

[self.library writeImageToSavedPhotosAlbum:image metadata:nil completionBlock:nil]:

it's by default saving to PhotoRoll and there is no option to change album. 默认情况下将其保存到PhotoRoll,并且没有更改相册的选项。

I found an older guide o how to save image to album using this code: 我找到了一个较旧的指南o如何使用此代码将图像保存到相册:

[self.library saveImage:img toAlbum:albumName withCompletionBlock:^(NSError *error) {
    if (error!=nil) {
        NSLog(@"Big error: %@", [error description]);
    }
}];

but it seems to be deprecated ... Is it possible to make it nondeprecated because i think that this method is the one I'm looking for. 但它似乎已被deprecated ...是否有可能使其deprecateddeprecated ,因为我认为这种方法是我正在寻找的方法。

All photos go to the SavedPhotos. 所有照片都转到“ SavedPhotos”。 Once you saved it there you can use the library method addAssetsGroupAlbumWithName:resultBlock:failureBlock: 一旦将其保存在那里,就可以使用库方法addAssetsGroupAlbumWithName:resultBlock:failureBlock:

and then the ALAssetsGroup method addAsset: 然后是ALAssetsGroup方法addAsset:

Please see this answer for more detail: Create, Delete, and add pictures to albums in the photos app? 请查看此答案以获取更多详细信息: 在“照片”应用中创建,删除照片并将照片添加到相册?

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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