Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Save NSWindow Size on Resize & Close For User

Tags:

I've noticed that all applications on OS X seem to save the size you set it at. The next time you open it it's typically in the same position and size.

I'm making an app and I've noticed that after resizing, if I launch the application again it's just the size of what I've set in Xcode 4's IB and not the size that I resized it to on launch.

Do I have to manually save the window size each time its changed? Or is there an easier way to do this through IB? (My window does have a minimum size set if that changes anything.)

like image 513
aroooo Avatar asked Apr 11 '12 23:04

aroooo


1 Answers

Apple makes it easy. In interface builder, for your window, just type in a unique name in the Autosave field and it will save it under that name in the global user defaults. E.G.

enter image description here

like image 121
Vervious Avatar answered Oct 14 '22 02:10

Vervious