Use of undeclared type 'AppDelegate' on Mac OS X app

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

Accepted Reply

It might be a target membership issue. Check both files are in the same target.


Also, you posted your question in the Core Data forum. Might be worthwhile posting it in the Cocoa Touch forum too.

Replies

It might be a target membership issue. Check both files are in the same target.


Also, you posted your question in the Core Data forum. Might be worthwhile posting it in the Cocoa Touch forum too.

It was a target membership issue:


The check mark for AppDelegate.swift got unchecked somehow.


Thanks