Question

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?

Was it helpful?

Solution

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 ";
    ...

OTHER TIPS

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
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top