在我的DeviceNotFound类中有一个窗口AppDelegate。
class AppDelegate: NSObject, NSApplicationDelegate {
let deviceNotFoundWindowController = NSStoryboard(name: "Main", bundle:nil).instantiateController(withIdentifier: "DeviceNotFoundWindowController") as! DeviceNotFoundWindowController
func test() {
if let loadDataVc = NSStoryboard(name: "Main", bundle:nil).instantiateController(withIdentifier: "LoadDataViewController") as? LoadDataViewController
{
self.deviceNotFoundWindowController.contentViewController!.presentViewControllerAsSheet(loadDataVc)
}
}
}当我调用test函数将另一个ViewController显示为工作表时,它会像窗口一样显示。我的DeviceNotFound窗口没有被封锁。我可以移动它:

发布于 2016-12-06 16:16:02
发现问题了。因为我从尼布那里得到的最初的window controller != deviceNotFoundWindowController。
https://stackoverflow.com/questions/40999750
复制相似问题