需要先导入头文件
#import <AssetsLibrary/AssetsLibrary.h>
ALAuthorizationStatus author = [ALAssetsLibrary authorizationStatus];
if( author == ALAuthorizationStatusRestricted || author == ALAuthorizationStatusDenied )
{
[SVProgressHUD showErrorWithStatus:@"您没有打开相册权限,请在设置里面打开相册权限"];
return;
}
原文:http://www.cnblogs.com/rollrock/p/4550618.html