Newbie here.
I created a test MacOS application project in Objective-C. XCode generated the basic classes including AppDelegate. The documentation says that when the app quits then the applicationWillTerminate message is sent to the NSApplicationDelegate, which is where my app cleanup code should go. But when I choose "Quit" in the "File" menu neither applicationShouldTerminate nor applicationWillTerminate are called. The app just quits. What is wrong here?
By the way, applicationDidFinishLaunching is called, so I know my appDelegate object has been installed in the NSApp correctly.
The documentation is out of date. Modern Xcode templates default these values to true:
Application can be killed immediately when user is shutting down or logging out, and
Application can be killed to reclaim memory or other extraordinary circumstances
I think it is "Application can be killed immediately when user is shutting down or logging out" that causes the behaviour you describe.
Is your app a document-based project? Because documents never get deleted. Been that way for years.