title: Setting NSWindow position in current screen
body: <p>I am newbie in objective-c.I have created a main window which I want to display in the right bottom of the current screen. I tried the following code </p>
  
  <pre><code>- (void)windowDidLoad
  {
      NSPoint pos;
  
      pos.x = [[NSScreen mainScreen] visibleFrame].origin.x + [[NSScreen mainScreen] visibleFrame].size.width - [mywindow frame].size.width ;
  
      pos.y = [[NSScreen mainScreen] visibleFrame].origin.y + [[NSScreen mainScreen] visibleFrame].size.height - [mywindow frame].size.height;
  
      [mywindow setFrameTopLeftPoint:pos];
  
  }
  </code></pre>
  
  <p>what is wrong with in it? How to resolve it?</p>