Get rid of "Want to open your windows again?" dialogues

I am building a Cocoa application with Xcode. I need to force kill the application for unrelated reasons, and every time I do this, I get this popup:

The last time you opened MyApp, it quits unexpectedly when you reopen windows. Do you want to open his windows again?

If you decide not to open the windows again, you may have to open and place the windows yourself.

[Do not reopen] [Reopen]

What is called this system and how to disable it for my application?

+5
source share
1 answer

This is Cocoa auto recovery in action. You can disable it when your application starts under Xcode by editing the active scheme, selecting the β€œRun” action and checking β€œRun the application without restoring state”.

Disabling state restoration in your app's scheme

Note. Disabling this will also disable the automatic reopening of documents that were previously opened, which can be a pain for testing a document-based application, as you will have to re-open the document manually each time it starts. It also only disables runtime recovery under Xcode under this particular scheme.

+3
source

All Articles