سؤال

line in my code

AVCaptureDevice *device = [AVCaptureDevice defaultDeviceWithMediaType:AVMediaTypeVideo];

for AVMediaTypeVideo xcode tells me ... Use of undeclared identifier 'AVMediaTypeVideo'; did you mean 'kCMMediaType_Video'?

a side note, I do have #import AVFoundation/AVCaptureDevice.h in my header

I am trying to make a "flashlight" effect in an app, that is the only line of code with a problem, according to Xcode ...

هل كانت مفيدة؟

المحلول

Have you imported the AVFoundation Framework into to your project?

Add #import <AVFoundation/AVFoundation.h> to your .m

نصائح أخرى

Try to add #import <AVFoundation/AVMetadataFormat.h>

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top