【发布时间】:2021-06-03 18:08:47
【问题描述】:
我正在使用 Swift 3 在我的 Apple macOS 计算机上制作应用程序
通过单击按钮并调用函数closeotherw(),从我称为w 的主窗口中[以这种方式] 关闭一个窗口很容易
@IBOutlet var w: NSWindow!
@IBOutlet var otherw: NSWindow!
@IBOutlet var otherw: NSPanel!
@IBAction func closeotherw(_ sender: AnyObject) {
otherw.close()
}
但是如何重新打开它[otherwin]?
我也尝试了各种方式,也喜欢w.isHidden = true,但没有结果。
我没有StoryBoard,也没有ViewController。
我在AppDelegate做所有事情。
【问题讨论】:
-
这能回答你的问题吗? How to hide the window
-
@Willeke 不。如果我让
otherw.orderOut()错误是Missing argument for parameter #1 in call -
@Willeke tnks 它工作
otherw.orderOut(self)it 方式
标签: swift xcode macos cocoa appdelegate