我尝试运行一些基本的OpenCV代码,打开网络摄像头。在我更新到Mac Mojave之前,我能够运行这个代码,但之后我在构建和运行时遇到了这个错误。
`[access] This app has crashed because it attempted to access privacy-
sensitive data without a usage description. The app's Info.plist must
contain an NSCameraUsageDescription key with a string value explaining
to the user how the app uses this data.`
我根据其他帖子上的步骤,在项目中(与main.cpp位于同一目录)创建了Info.plist文件,但是系统报错说无法解析Info.plist文件的内容。
Info.plist文件内容如下:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN"
"http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>NSCameraUsageDescription</key>
<string>uses camera to see vision targets</string>
</dict>
我该如何解决这个问题并让它读取Info.plist文件?