My application have use camera then compress image JPEG, with ios version < 10 , I have use AVCaptureStillImageOutput but ios version >= 10 I use AVCapturePhotoOutput error.I have setting code:`
self.photoOutput = [[AVCapturePhotoOutput alloc] init];
AVCapturePhotoSettings *photoSettings =
[AVCapturePhotoSettings photoSettingsWithFormat:@{AVVideoCodecKey : AVVideoCodecJPEG}];
[self.photoOutput capturePhotoWithSettings:photoSettings delegate:self];
[self.session addOutput:self.photoOutput];`
I have problems when run app, app crash with error:
[AVCapturePhotoOutput capturePhotoWithSettings:delegate:] No active and enabled video connection
Does anybody know how to use this? Thanks.
The sequence to make the connection is important.