标签:location str sap smo sage ons plist 开启 string
info.plist中逐个添加 KEY直接复制 value的string字符串就是提示的文字 可以根据自己需要填写
#import<AVFoundation/AVCaptureDevice.h>
#import <AVFoundation/AVMediaFormat.h>
#import<AssetsLibrary/AssetsLibrary.h>
#import<CoreLocation/CoreLocation.h>
//相机权限
AVAuthorizationStatus authStatus = [AVCaptureDeviceauthorizationStatusForMediaType:AVMediaTypeVideo];
if (authStatus ==AVAuthorizationStatusRestricted ||//此应用程序没有被授权访问的照片数据。可能是家长控制权限
authStatus ==AVAuthorizationStatusDenied) //用户已经明确否认了这一照片数据的应用程序访问
{
// 无权限 引导去开启
NSURL *url = [NSURLURLWithString:UIApplicationOpenSettingsURLString];
if ([[UIApplicationsharedApplication]canOpenURL:url]) {
[[UIApplicationsharedApplication]openURL:url];
}
}
//相册权限
ALAuthorizationStatus author = [ALAssetsLibraryauthorizationStatus];
if (author ==kCLAuthorizationStatusRestricted || author ==kCLAuthorizationStatusDenied){
//无权限 引导去开启
NSURL *url = [NSURL URLWithString:UIApplicationOpenSettingsURLString];
if ([[UIApplication sharedApplication] canOpenURL:url]) {
[[UIApplication sharedApplication] openURL:url];
}
}
标签:location str sap smo sage ons plist 开启 string
原文地址:http://www.cnblogs.com/zjoch/p/6133321.html