3
votes

I've been killing myself over this issue in Cocoa and Lion and was wondering if anyone has come across this issue and (hopefully) found a solution.

I've got a very simple project (code can be downloaded here: http://cl.ly/2T0N2C1A3K1r2h1q0R1e ) where a NSWindowController assigns the position of a window using the setFrameOrigin: method on an NSWindow.

On first run this works A-OK, but once the user moves the window, quits & restarts the app the window restores it's previous location instead of employing the setFrameOrigin: command.

The NSWindowController already has cascade and autosave disabled so it shouldn't be happening.

Also, i've tested on Snow Leopard and the code works 100% - it's a Lion only issue.

Any ideas?

1

1 Answers

10
votes

That's Lion's "User Interface Preservation" feature, which is documented in the App Programming Guide

The simple solution is to uncheck "Restorable" in the window's attributes pane.