title: Cocoa window position anomaly
body: <p>I have a weird problem with positioning a window on screen. I want to center the window on the screen, but i don't know how to do that. Here's what i've got. The window is created from nib by the main controller:</p>
  
  <pre><code>IdentFormController *ftf = [[IdentFormController alloc] initWithWindowNibName:@"IdentForm"];
  [[ftf window] makeKeyAndOrderFront:self];
  </code></pre>
  
  <p>Now the IdentFormController has awakeFromNib() method in which it tries to position the window. For the sake of simplicity i've just tried to do setFrameOrigin(NSMakePoint(0, 0)). What happens is as follows:</p>
  
  <p>The first time i create this window, everything works as expected. But if i create it again after releasing the previous, it starts appearing at random positions. Why does it do that?</p>