0

I am working with Cocoa, doing some tutorials. My question is how do I stop an application from picking up from where it left off after quitting? Like, how do I reset window size, position, etc?

And how do I set an initial position?

Peter Hosey
  • 95,783
  • 15
  • 211
  • 370
Jon Wei
  • 1,481
  • 2
  • 10
  • 18
  • 2
    Why? Those are features built into iOS and Mac OS and users expect it. You should have a very very good reason to go against an OS feature. Just food for though. – Ryan Poolos May 17 '12 at 00:50
  • Other Applications or your application ? – 0x8badf00d May 17 '12 at 00:52
  • I am currently learning about sizes. So after resizing a window, printing out the size, and quitting (my application), after running it again, it keeps that resized size. I want to disable this explicity for this application. – Jon Wei May 17 '12 at 00:54
  • 1
    http://stackoverflow.com/questions/7466824/prevent-resume-for-my-cocoa-application/7467045#7467045 – 0x8badf00d May 17 '12 at 01:06

1 Answers1

2

If you uncheck the "Restorable" box in IB, the window will always start with the size and position that you set in IB..

rdelmar
  • 103,982
  • 12
  • 207
  • 218
  • Two drawbacks: (1) You would have to set this for every window, and (2) it would affect your users as well, not simply help you debug the application from a clean state. – Peter Hosey May 17 '12 at 06:47