简体   繁体   English

Xcode for MacOS Mojave中的C ++项目需要NSCameraUsageDescription

[英]NSCameraUsageDescription needed for C++ projects in Xcode for MacOS Mojave

I am trying to run OpenCV projects in Xcode and it seems like there's a new need to provide an info.plist for C++ applications NSCameraUsageDescription. 我试图在Xcode中运行OpenCV项目,似乎有新的需要为C ++应用程序NSCameraUsageDescription提供info.plist。

2018-09-28 00:03:15.181948+0800 k_nearest_detector_v2[23505:710470] [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.
Program ended with exit code: 9

How do I go about creating a .plist file for a C++ project as it has never been needed before. 我如何为C ++项目创建一个.plist文件,因为它以前从未需要过。

Found a solution. 找到了解决方案。 Put the file with the desired NSCameraUsageDescription, NSMicrophoneUsageDescription (or others) with the assembled file from XCode (See screen shots below). 将带有所需NSCameraUsageDescription,NSMicrophoneUsageDescription(或其他)的文件与来自XCode的汇编文件放在一起(参见下面的屏幕截图)。 For the Release and Debug versions. 对于Release和Debug版本。 产品 - >右键单击 - >在Finder中显示“的Info.plist”

You can even automate the steps described by @Valery Gromov. 您甚至可以自动执行@Valery Gromov所描述的步骤。 Just copy the file in the Build Phases. 只需在Build Phases中复制该文件即可。 Uncheck the Copy only when installing checkbox to be able to run it directly from Xcode. 取消选中“ Copy only when installing复选框,以便能够直接从Xcode运行它。 复制Info.plist

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM