这是按钮的动作:
@IBAction func readyPressed(sender: NSButton) {
self.dismissController(Hardness)
println(1)
self.performSegueWithIdentifier("manual", sender: self)
}
当我按下按钮时,println 起作用,segue 起作用,但 NSViewController "Hardness" 没有关闭。
这是按钮的动作:
@IBAction func readyPressed(sender: NSButton) {
self.dismissController(Hardness)
println(1)
self.performSegueWithIdentifier("manual", sender: self)
}
尝试使用以下代码行关闭窗口:self.view.window?.close()
NSViewController
,似乎仍然需要使用这个。 - Clifton Labrum你可以尝试使用
NSViewController().dismiss(vc).
要被解除的视图控制器应该作为参数传递,调用者可以是任何NSViewController对象。
请尝试使用
self.dismissViewControllerAnimated(true, completion: {});
或者使用
navigationController.popViewControllerAnimated(true)
如下所示