AVCaptureDevice找不到任何设备 [英] AVCaptureDevice doesnt find any device

查看:106
本文介绍了AVCaptureDevice找不到任何设备的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这行代码是我今天遇到的问题(macOS应用):

This line of code is the problem I got today (macOS app):

NSArray *devices = [AVCaptureDevice devicesWithMediaType:AVMediaTypeVideo];

更新Xcode后,系统总是让我空出 devices 阵列.

After I update Xcode, the system is alway got me empty devices array.

问题是,旧项目(在更新之前创建)可以按预期工作.

The thing is, the old projects(created before the update) work as expected.

这是怎么回事...?

有人有同样的问题吗?

------------ UPDATE --------

我发现这不仅发生在我的Mac上, 也在公司的.

I found this not just happened to my mac, also on the company's.

它确实影响了我的工作.

And it does affect my work.

推荐答案

我想我找到了答案...

I think I found the answer...

目标设置/功能/应用沙箱/硬件

Target Settings / Capabilities / App sandbox / Hardware

这篇关于AVCaptureDevice找不到任何设备的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆