【发布时间】:2019-08-23 04:38:00
【问题描述】:
我创建了 NSApplication 子类:
class MyApplication: NSApplication {
override func sendEvent(theEvent: NSEvent) {
if theEvent.type == NSEventType.KeyUp && (theEvent.modifierFlags & .CommandKeyMask).rawValue != 0 {
self.keyWindow?.sendEvent(theEvent)
} else {
super.sendEvent(theEvent)
}
}
}
之后,我将 Info.plist 中的“Principal class”更改为 MyApplication,最后在 Main.storyboard 的 Application Scene 中,我也将 Application 更改为 MyApplication。
当我运行应用程序时,我收到以下消息:
找不到类:MyApplication,正在退出
有人可以帮我解决这个问题吗?
【问题讨论】:
标签: swift nsapplication