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。)
任何帮助表示赞赏。谢谢,保罗
NSCameraUsageDescription, NSMicrophoneUsageDescription