我想检查图书馆是否存在。如何检查是否已经存在同名的库?
我想以编程方式检查由以下代码创建的库是否存在,我如何以编程方式检查库是否存在?
谢谢
我使用以下代码保存自定义库。
//Code for create custom library and save image
-(void)savePhoto
{
self.library = [[ALAssetsLibrary alloc] init];
[self.library addAssetsGroupAlbumWithName:@"My Library" resultBlock:nil failureBlock:nil];
[self savePhotoFinal:[UIImage imageNamed:@"tattoo1.jpg"];
}
-(void)savePhotoFinal:(UIImage *)image
{
[self.library saveImage:image toAlbum:@"My Library" withCompletionBlock:^(NSError *error) {
if (error!=nil) {
NSLog(@"Big error: %@", [error description]);
}
}];
}