title: How to reference/open a window in Objective-c
body: <p>I need to get a reference to the single window in my app. If I tick off "Visible at launch" it shows up.</p>
  
  <p>I keep seeing code like the following but that doesn't make much sense. How would self know about a window in a nib file if its not declared anywhere in the interface? </p>
  
  <pre class="lang-cocoa prettyprint-override"><code>NSWindow *window = [self window]; 
  </code></pre>
  
  <p>When I run that in applicationDidFinishLaunching, I get this error:</p>
  
  <pre><code>No visible @interface for 'AppDelegate' declares the selector 'window'
  </code></pre>
  
  <p>That makes sense, because no interface is declared. Yet how is the window loading automatically when 'Visible at launch' is ticked?</p>
  
  <p>My end goal is that I need to reference a window and change its level, i.e.</p>
  
  <pre class="lang-cocoa prettyprint-override"><code>[window setLevel:NSFloatingWindowLevel];
  </code></pre>
  
  <p>Please help?</p>