Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Where does the setFrameAutosaveName method save the window's position?

I know that Cocoa could save a window's position in user defaults using setFrameAutosaveName: or saveFrameUsingName: method.

But where is user defaults?

Is it in the fixed place for every application?

like image 867
Gon Avatar asked Oct 18 '25 14:10

Gon


2 Answers

It is stored in your applications user defaults. For each window it creates a default with a fixed prefix of NSWindow Frame and appends your window's autosave name. Example:

defaults read my.app.identifier
    ...
    "NSWindow Frame MyWindowAutoSaveName" = "386 174 1811 1080 0 0 2560 1418 ";
    ...
like image 176
Gerd K Avatar answered Oct 21 '25 11:10

Gerd K


For sandboxed apps:

~/Library/Containers/my.app.identifier/Data/Library/Preferences/my.app.identifier.plist

For non-sandboxed apps:

~/Library/Preferences/my.app.identifier.plist
like image 22
Manabu Avatar answered Oct 21 '25 12:10

Manabu



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!