iOS开发调用相机时出现黑屏的解决办法(原因:没有获取到相机权限)
在开发过程中调用系统相机,但是页面出现黑屏,原因是自己只进行了部分的相机权限的判断没有根据系统的版本判断,
if ([[[UIDevice currentDevice] systemVersion] floatValue] >= 7.0) {
AVAuthorizationStatus authStatus = [AVCaptureDevice authorizationStatusForMediaType:AVMediaTypeVideo];
if (authStatus == AVAuthorizationStatusDenied || authStatus == AVAuthorizationStatusRestricted)
{
UIAlertController *alert = [UIAlertController alertControllerWithTitle:@"打开相机权限" message:nil preferredStyle:UIAlertControllerStyleAlert];
UIAl