deviceNotFoundWindowController

deviceNotFoundWindowController

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

swift - presentViewControllerAsSheet显示类似窗口-LMLPHP

最佳答案

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

关于swift - presentViewControllerAsSheet显示类似窗口,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/40999750/

10-16 22:48