Platforms to show: All Mac Windows Linux Cross-Platform

NSApplicationDelegateMBS class

Type Topic Plugin Version macOS Windows Linux iOS Targets
class Cocoa MBS MacCocoa Plugin 11.2 ✅ Yes ❌ No ❌ No ❌ No Desktop only
The class for an Cocoa application delegate.

Please install in app Constructor as App.Open event may be too late.

Using this class you can get application related events before (!) the app class gets it. And of course more events than just the onces the app class have.

Only for Cocoa desktop targets.

In general the plugin calls first the event. Depending on the result it may pass the event to the Xojo application delegate. If you have no code in the plugin event, everything just passes through and you should not see a difference.

The plugin application delegate is installed with the Constructor and uninstalled in the Destructor.

The original delegate from Xojo is preserved and all messages are forwarded to it. Also when this object is destroyed, the old delegate is restored.

Print Reply Constants

Constant Value Description
NSPrintingCancelled 0 Printing was cancelled.
NSPrintingFailure 3 Printing failed.
NSPrintingReplyLater 2 The result of printing cannot be returned immediately, for example, if printing will cause the presentation of a sheet. If your method returns NSPrintingReplyLater it must always invoke replyToOpenOrPrint when the entire print operation has been completed, successfully or not.
NSPrintingSuccess 1 Printing was successful.

Terminate Reply Constants

Constant Value Description
NSTerminateCancel 0 The application should not be terminated.
NSTerminateLater 2 It may be OK to proceed with termination later. Returning this value causes Cocoa to run the run loop in the NSModalPanelRunLoopMode until your application subsequently calls replyToApplicationShouldTerminate with the value true or false. This return value is for delegates that need to provide document modal alerts (sheets) in order to decide whether to quit.
NSTerminateNow 1 It is OK to proceed with termination.

This class has no sub classes.

Some examples using this class:

Blog Entries

Release notes


The items on this page are in the following plugins: MBS MacCocoa Plugin.


NSAppleScriptMBS   -   NSApplicationMBS


The biggest plugin in space...