Frage

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?

War es hilfreich?

Lösung

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

Andere Tipps

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
Lizenziert unter: CC-BY-SA mit Zuschreibung
Nicht verbunden mit StackOverflow
scroll top