【发布时间】:2020-01-02 04:38:41
【问题描述】:
MacOS 10.14
<key>NSMicrophoneUsageDescription</key>
<string>Record audio!</string>
这适用于一个快速的项目:
AVCaptureDevice.requestAccess(for: .audio) { granted in
if granted {
//self.setupCaptureSession()
}
}
但这在 ObjectiveC 项目中不起作用(线程 8:信号 SIGABRT)
[AVCaptureDevice requestAccessForMediaType:AVMediaTypeAudio completionHandler:^(BOOL granted) {
if (granted) {
//self.microphoneConsentState = PrivacyConsentStateGranted;
}
else {
//self.microphoneConsentState = PrivacyConsentStateDenied;
}
}];
我在 ObjectiveC 项目中做错了什么或错过了什么? (我不想将我的项目转换为 swift。)
任何帮助表示赞赏。谢谢,保罗
【问题讨论】:
标签: objective-c crash avcapturedevice