문제

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?

도움이 되었습니까?

해결책

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

다른 팁

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
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top