我的应用程序使用相机然后压缩图像 JPEG,ios 版本 < 10,我使用 AVCaptureStillImageOutput 但 ios 版本 >= 10 我使用 AVCapturePhotoOutput 错误。我有设置代码:`
self.photoOutput = [[AVCapturePhotoOutput alloc] init];
AVCapturePhotoSettings *photoSettings =
[AVCapturePhotoSettings photoSettingsWithFormat:@{AVVideoCodecKey : AVVideoCodecJPEG}];
[self.photoOutput capturePhotoWithSettings:photoSettings delegate:self];
[self.session addOutput:self.photoOutput];`
我在运行应用程序时遇到问题,应用程序崩溃并出现错误:
[AVCapturePhotoOutput capturePhotoWithSettings:delegate:] No active and enabled video connection
有人知道如何使用这个吗?谢谢。