码迷,mamicode.com
首页 > 移动开发 > 详细

IOS 判断相册是否允许访问

时间:2014-11-28 18:33:52      阅读:167      评论:0      收藏:0      [点我收藏+]

标签:ios 判断相册是否允许访问

  1. ALAssetsLibrary *library = [[ALAssetsLibrary alloc]init];  

  2.     [library writeImageToSavedPhotosAlbum:image.CGImage orientation:image.imageOrientation completionBlock:^(NSURL *asSetUrl,NSError *error){  

  3.         if (error) {  

  4.             UIAlertView *alert = [[UIAlertView alloc]initWithTitle:@"保存图片失败"  

  5.                                                            message:@"请打开 设置-隐私-照片 来进行设置"  

  6.                                                           delegate:nil  

  7.                                                  cancelButtonTitle:@"确定"  

  8.                                                  otherButtonTitles:nil, nil];  

  9.             [alert show];  

  10.             [alert release];  

  11.         }else{  

  12.             UIAlertView *alert = [[UIAlertView alloc]initWithTitle:@"保存图片成功"  

  13.                                                            message:nil  

  14.                                                           delegate:nil  

  15.                                                  cancelButtonTitle:@"确定"  

  16.                                                  otherButtonTitles:nil, nil];  

  17.             [alert show];  

  18.             [alert release];  

  19.         }  

  20.           

  21.     }];  


IOS 判断相册是否允许访问

标签:ios 判断相册是否允许访问

原文地址:http://liumenglin.blog.51cto.com/7734570/1584027

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!