I am creating a window controller that I want to add to my Document object in the Document's makeWindowControllers function. However, after I have added this window controller, I can not resolve the windowController's Document object. This property should be set by my Document on the window controller in the addWindowController call. Any ideas as to why this might be the case?
let movieStoryboard = NSStoryboard(name: NSStoryboard.Name("MovieWindowStoryboard"), bundle: nil)
movieWindowController = movieStoryboard.instantiateController(withIdentifier: NSStoryboard.SceneIdentifier("MovieWindowController")) as? NSWindowController
self.addWindowController(movieWindowController)
movieWindowController.window?.performClose(self)