That's the button action:
@IBAction func readyPressed(sender: NSButton) {
self.dismissController(Hardness)
println(1)
self.performSegueWithIdentifier("manual", sender: self)
}
When I press the button, println works, segue works, but NSViewController "Hardness" doesn't close
试试这一行来关闭窗口: self.view.window?.close()
You must add Action from button to First Responder - dismissController:
you can try
NSViewController().dismiss(vc).
the viewcontroller to be dismissed should be passed as argument and the caller could be any NSViewController object.
Please try using
self.dismissViewControllerAnimated(true, completion: {});
or use
navigationController.popViewControllerAnimated(true)
as presented here
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.