Are you ending the application with Xcode? Alternatively, unexpected termination is included in your Info.plist?
Any of them will cause the SIGTERM signal to be sent to the application, immediately terminating it, without the possibility of an NSApplication instance, sending the applicationWillTerminate: message to its delegate. (This is the point of abrupt termination: your application dies instantly. You can disable it programmatically if it is bad.)
Try abandoning your application within yourself (the "Exit" menu item in the "Application" menu) or using the Dock to exit it (right-click on your application bar and select "Quit"). While abrupt termination is disabled (or has never been enabled), any of these will cause your application object to send an applicationWillTerminate: message.
Also, make sure your delegate sends other application delegate messages, such as applicationWillFinishLaunching: and make sure you plug the socket in the correct tip (your MainMenu nib).
Peter Hosey Dec 01 '10 at 3:50 2010-12-01 03:50
source share