实际运用场景:
上传图片,查看相机设备,使用相机 在做这些操作的时候先调用这段话
AVAuthorizationStatus authStatus = [AVCaptureDevice authorizationStatusForMediaType:AVMediaTypeVideo];
if (authStatus == AVAuthorizationStatusRestricted || authStatus ==AVAuthorizationStatusDenied)
{
UIAlertView *alertView = [[UIAlertView alloc] initWithTitle:@"提示" message:@"未获得授权使用相机,请在iOS\"设置中\"-\"隐私\"-\"相机\"中打开" delegate:nil cancelButtonTitle:@"确定" otherButtonTitles:nil];
[alertView show];
return;
}