I'm building a Cocoa application with Xcode. I have to force-kill my app for unrelated reasons, and every time I do I get this popup:
The last time you opened MyApp, it unexpectedly quit while reopening windows. Do you want to try to reopen its windows again?
If you choose not to reopen windows, you may have to open and position the windows yourself.
[Don't Reopen] [Reopen]
What is this system called and how can I disable it for my application?
This is Cocoa's automatic state restoration in action. You can suppress it when your app is launched under Xcode by editing your active scheme, choosing the Run action, and checking "Launch application without state restoration".
Note: Disabling this will also disable automatically-reopening documents that were opened previously, which can be a pain for testing a document-based application, since you'll have to re-open the doc manually each time you run it. This also only disables state restoration while being run under Xcode under that particular scheme.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With