Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

john903

macrumors member
Original poster
Apr 11, 2008
66
0
How do you save the position and size of the window in a Cocoa app so the window is the same after you close and open the program?
 

john903

macrumors member
Original poster
Apr 11, 2008
66
0
Yes, I found that one but I don't understand how to obtain a pointer to an NSWindow. I'm new to Cocoa.

Also, what method would I put this code in?

Thanks for your help!
 

Sayer

macrumors 6502a
Jan 4, 2002
981
0
Austin, TX
If the window is from a nib you can set a "Frame Name" in IB3's inspector (first panel) or auto save name in older IB I believe, and Cocoa will automatically save the size/position info to the preferences file when the window is closed.
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.