【发布时间】:2014-11-13 13:44:28
【问题描述】:
我在 Swift 文件(不是 Objective-C)中的 Xcode 编辑器中遇到了很多 undeclared type 错误,尽管当我实际编译它时代码运行良好。例如,我的应用委托(未从模板更改):
import Cocoa
@NSApplicationMain // 'NSApplicationMain' class must conform to the 'NSApplicationDelegate' protocol
class AppDelegate: NSObject, NSApplicationDelegate { // Use of undeclared type 'NSApplicationDelegate'
// Methods
}
在整个项目中都是一样的,例如。我的视图控制器说 NSViewController 和 NSTextView 是未声明的标识符。我已经尝试过清理、清除派生数据和通常的东西。有什么想法吗?
【问题讨论】: