title: Closed NSWindow shows up when NSSavePanel is presented (osx cocoa)
body: <p>I have wrote an OSX storyboard application that has a splash screen. It is a NSWindow with NSWindowController, without subclassing, that have a SplashViewController that subclasses NSViewController.</p>
  
  <p>Here is the code of SplashViewController:</p>
  
  <pre><code>- (void)viewDidLoad {
      [super viewDidLoad];
  
      _timer = [NSTimer scheduledTimerWithTimeInterval:5 target:self selector:@selector(timeOut) userInfo:nil repeats:NO];
  }
  
  - (void)timeOut
  {
      [self performSegueWithIdentifier:@"main" sender:self];
  }
  
  - (void)prepareForSegue:(NSStoryboardSegue *)segue sender:(id)sender
  {
      [_timer invalidate];
       _timer = nil;
  
      [self.view.window.windowController close];
  }
  </code></pre>
  
  <p>This closes the window/window controller as expected.</p>
  
  <p>The segue has <strong>show</strong> type and presents another NSWindowController which has MainViewController, subclass of NSViewController. When MainViewController opens a save dialog:</p>
  
  <pre><code>NSArray *a = [[NSApplication sharedApplication] windows];
  NSLog(@"%ld", a.count);
  
  NSSavePanel *savePanel = [NSSavePanel savePanel];
  [savePanel setAllowedFileTypes:@[@"pdf"]];
  [savePanel setDirectoryURL:[NSURL URLWithString:NSHomeDirectory()]];
  [savePanel beginSheetModalForWindow:self.view.window completionHandler:nil];
  </code></pre>
  
  <p>an old splash window comes up (and "1" is printed). What the? I mean why it is showing up? And what NSSavePanel has to do with it?</p>