AppDelegate causes "undeclared identifier"error

Hello:


in two of my swift files i used the declaration:


let appDelegate = NSApplication.shared.delegate as! AppDelegate


Xcode did not raise any objection until today. I did not make any changes to the code in the two files. Now i am getting the build error:

Use of undeclared type 'AppDelegate'


Can anyone help me to know where to Look to remove the objection?


Thanks

Now i am getting the build error:

What did change between now and before ?


Did you upgrade XCode ?

id you upgrade MacOS ?


Where exactly did you use the declaration ?


You should try, in order:

- do an option clean build folder

if not enough

- close XCode and reopen

if not enough

- reboot the Mac


PS: I gather it is a MacOS app. If so, you'd better post in Cocoa, not Cocoa Touch.

Hello Claude 31:


I found the issue after reading "alienspaces" comment.

It was a target membership issue. My AppDelegate.swift file got unchecked in Target Membership, so the declaration was not reaching the other two filed that neded that declaration in AppDelegate.swift


Thanks.

Thanks for the feedback. That's probably a setting you did change without noticing.


Good continuation and don't forget to close the thread.

AppDelegate causes "undeclared identifier"error
 
 
Q