How can I easily save the Window size and position state using Obj-C?

Put a name that is unique to that window (e.g. “MainWindow” or “PrefsWindow”) in the Autosave field under Attributes in Interface Builder. It will then have its location saved in your User Defaults automatically.

To set the Autosave name programmatically, use -setFrameAutosaveName:. You may want to do this if you have a document-based App or some other situation where it doesn’t make sense to set the Autosave name in IB.

Link to documentation.

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)