我的应用程序使用了摄像头然后压缩图像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];`
我在运行app时遇到问题,app崩溃并出现错误:
[AVCapturePhotoOutput capturePhotoWithSettings:delegate:] No active and enabled video connection
有谁知道怎么用这个吗?谢谢。
https://stackoverflow.com/questions/41156017
复制相似问题