当我尝试启动应用程序时,它只是崩溃。它给出的错误是unrecognized selector sent to instance 0x608000000ac0
,并且在第4行上显示了错误的错误。
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
}
}
如何解决此错误?提前致谢,aaronjam
尝试解决问题一个多小时后,我删除了目标(当然,在备份代码之后)并制作了一个新的目标。感谢您的帮助,@overd!