判断当前应用是否允许访问相机

NSString *mediaType = AVMediaTypeVideo;

AVAuthorizationStatus authStatus = [AVCaptureDevice authorizationStatusForMediaType:mediaType];

if(authStatus == AVAuthorizationStatusRestricted || authStatus == AVAuthorizationStatusDenied){

UIAlertView *alert = [[UIAlertView alloc] initWithTitle:nil message:@"请在iPhone的 设置-隐私-相机 选项中,允许微阵访问你的相机" delegate:nil cancelButtonTitle:@"好" otherButtonTitles:nil, nil];

[alert show];

return;

}

你可能感兴趣的:(判断当前应用是否允许访问相机)