2016-12-06 1 views
0

У меня есть окно DeviceNotFound в моем классе AppDelegate.presentViewControllerAsSheet показывает как окно

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

ответ

0

О, найденную проблему. Потому что мой начальный window controller != deviceNotFoundWindowController, который я получаю от nib.

Смежные вопросы