0

I have a file-based Objective C app for macOS. When the user starts the app, macOS automatically reopens files that were open when the user last ran the app. I want to prevent that, sometimes.

I'd like to use AppDelegate applicationWillFinishLaunching to suppress the file opening, or just delete the cache of names, but can't find an interface or the location of the cache.

1 Answers1

0

Answering my own question: I find in Apple's "Document Based App Programming Guide for Mac" information on autosaving and restoring windows, and that I can trap the restore by subclassing NSApplication and overriding its restoreWindowWithIdentifier:state:completionHandler: method.