【发布时间】:2017-11-26 13:42:44
【问题描述】:
当我尝试启动我的应用程序时,它只是崩溃了。它给出的错误是unrecognized selector sent to instance 0x608000000ac0,错误显示在我的 AppDelegate.swift 文件的第 4 行。这是完整的 AppDelegate.swift 文件:
import Cocoa
@NSApplicationMain
class AppDelegate: NSObject, NSApplicationDelegate { //This is where I get the error
@IBOutlet weak var window: NSWindow!
func applicationDidFinishLaunching(_ aNotification: Notification) {
// Insert code here to initialize your application
}
func applicationWillTerminate(_ aNotification: Notification) {
// Insert code here to tear down your application
}
func applicationShouldTerminateAfterLastWindowClosed(_ sender: NSApplication) -> Bool {
return true
}
}
如何解决此错误?提前致谢, 亚伦詹姆
【问题讨论】:
标签: swift macos crash runtime-error appdelegate