I'm developing a MacOSX app and I don't know how to change the main window created by AppDelegate by another created by me in another ViewController. Actually I instantiate the viewController and set the main view to the AppDelegate window content view, but I want to change this in order to show only another window I have in the ViewController XIB, how can I do this?
Here is my XIB structure and AppDelegate content:
func applicationDidFinishLaunching(aNotification: NSNotification) {
// Insert code here to initialize your application
mainController = MainController(nibName: "MainController", bundle: nil)
//window.contentView!.addSubview(mainController.view)
//mainController.view.frame = (window.contentView! as NSView).bounds
window = mainController.mainWindow
//Setiing MOC to MainController:
//mainController.managedObjectContext = self.managedObjectContext
}
As you can see I tried to set the AppDelegate Window to my ViewController Window but it show nothing, maybe is because the controller is not created yet?
Thanks for all :).