presentViewControllerAsSheet显示像窗口

问题描述:

我在我的AppDelegate类中有一个窗口DeviceNotFoundpresentViewControllerAsSheet显示像窗口

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窗口未被阻止。我可以移动它:

enter image description here

哦,发现问题。因为我从笔尖得到的最初window controller != deviceNotFoundWindowController