Semantic issue: using an undeclared identifier when adding Framework class links

I added some frameworks to my project using Target -> Build Phases -> Link binary with libraries. In particular, I'm talking about AVFoundation.framework. I also added all the frameworks to the Frameworks folder in the project navigator.

However, when I try to reference classes in a related framework, I get errors "Semantic problem - using an undeclared identifier."

For example, I get these errors in the bottom two lines:

- (void)viewDidLoad { [super viewDidLoad]; AVCaptureSession *session = [[AVCaptureSession alloc] init]; session.sessionPreset = AVCaptureSessionPresetMedium; } 

I am wondering if the frameworks are connected correctly with my project. So how can I solve this? I have to say that I am new to iOS and ObjC development.

thanks

+4
source share
1 answer

Looks like you forgot:

 #import <AVFoundation/AVCaptureSession.h> 
+10
source

Source: https://habr.com/ru/post/1436113/


All Articles