In current NSWindowController, add a child window (mainViewController.window),then close current window,BUT when the method [self.window close] is called, the App terminated(not crash,because I can get the log message form method windowWillClose);
[self.window addChildWindow:mainViewController.window ordered:NSWindowAbove];
[self.window close];
What I want is : close current window when a new window showed.Is my way wrong?
=================================== UPDATE ====================================
Thanks @rdelmar, my mistake ,the App is not terminated,just all windows closed .
[self.window orderFront:mainViewController.window];
[self.window close];