I have a controller class which spawns a window when a certain condition occurs. This window can be closed by the user, moved around or resized.
Ideally, when this condition occurs, I’d like the window to re-open in the same spot the user closed it last time.
Looking for an elegant way to do this. Pointers (or references) will be most welcome.
Luckily, AppKit knows this is a common pattern and has provided
-setFrameAutosaveName:, which does this automatically for you. (If you’re usingNSWindowControlleryou’ll want to callsetShouldCascadeWindows:NO, which will override this.)