Cocoa How to remember the window position with multiple monitors?

| | August 5, 2015

To save window position for one(main) monitor i’m using this code:

[[win windowController] setShouldCascadeWindows:NO]; 
[win setFrameAutosaveName:@"My App"];

It’s works fine.
But if I connect second monitor and drag my app window to second monitor, cocoa autosave does not work – after restart, window always placed on primary(main) monitor.
Any ideas?
Thank you!

Leave a Reply