title: Adding NSView to window not on top?
body: <p>I am adding a subview programmatically and adding it to the main windows context view to cover up the entire context view like so:</p>
  
  <pre><code>loadingView = [[LoadingView alloc] initWithFrame:[mainWindow.contentView frame]];
  
  NSLog(@"%@", [mainWindow.contentView subviews]);
  [mainWindow.contentView addSubview:loadingView];
  NSLog(@"%@", [mainWindow.contentView subviews]);
  
  [mainWindow makeFirstResponder:loadingView];
  </code></pre>
  
  <p>The <code>NSLog's</code> confirm that <code>loadingView</code> is being added last in the <code>contentView</code> subviews.  I have also tried:</p>
  
  <pre><code>loadingView = [[LoadingView alloc] initWithFrame:[mainWindow.contentView frame]];
  [mainWindow.contentView addSubview:loadingView positioned:NSWindowAbove relativeTo:nil];
  [mainWindow makeFirstResponder:loadingView];
  </code></pre>
  
  <p>That didn't work either.  For some reason the two tableviews (created in IB) at the bottom of the window are on top of the new view I've added.  Here's a snapshot of the window, note that the red part is what should be on top with the progress bar and a few labels:</p>
  
  <p><img src="https://i.stack.imgur.com/v33YY.png" alt="loadingView"></p>
  
  <p>It's also worth noting that the view has it's alpha set to 0.9 which is why you can somewhat see behind it.</p>
  
  <p>GW</p>