Global Variable

NSWorkspaceDidTerminateApplicationNotification

A notification that the workspace posts when an app finishes executing.

Declaration

NSNotificationName NSWorkspaceDidTerminateApplicationNotification;

Discussion

The notification object is the shared NSWorkspace instance. In macOS 10.6 and later, the userInfo dictionary contains the NSWorkspaceApplicationKey key with a corresponding instance of NSRunningApplication that represents the affected app.

In macOS 10.5 and earlier, the userInfo dictionary contains the keys and values described in Table 1.

The system does not post this notification for background apps or for apps that have the LSUIElement key in their Info.plist file. If you want to know when all apps (including background apps) launch or terminate, use key-value observing to monitor the value returned by the runningApplications method.

See Also

Responding to Environment Notifications

NSWorkspaceWillLaunchApplicationNotification

A notification that the workspace posts when the Finder is about to launch an app.

NSWorkspaceDidLaunchApplicationNotification

A notification that the workspace posts when a new app has started up.

NSWorkspaceSessionDidBecomeActiveNotification

A notification that the workspace posts after a user session is switched in.

NSWorkspaceSessionDidResignActiveNotification

A notification that the workspace posts before a user session is switched out.

NSWorkspaceDidHideApplicationNotification

A notification that the workspace posts when the Finder hid an app.

NSWorkspaceDidUnhideApplicationNotification

A notification that the workspace posts when the Finder unhid an app.

NSWorkspaceDidActivateApplicationNotification

A notification that the workspace posts when the Finder is about to activate an app.

NSWorkspaceDidDeactivateApplicationNotification

A notification that the workspace posts when the Finder deactivated an app.

NSWorkspaceDidRenameVolumeNotification

A notification that the workspace posts when a volume changes its name or mount path.

NSWorkspaceDidMountNotification

A notification that the workspace posts when a new device has been mounted.

NSWorkspaceWillUnmountNotification

A notification that the workspace posts when the Finder is about to unmount a device.

NSWorkspaceDidUnmountNotification

A notification that the workspace posts when the Finder unmounts a device.

NSWorkspaceDidChangeFileLabelsNotification

A notification that the workspace posts when the Finder file labels or colors change.

NSWorkspaceActiveSpaceDidChangeNotification

A notification that the workspace posts when a Spaces change occurs.

NSWorkspaceDidWakeNotification

A notification that the workspace posts when the machine wakes from sleep.

NSWorkspaceWillPowerOffNotification

A notification that the workspace posts when the user requests a logout or powers off the machine.

NSWorkspaceWillSleepNotification

A notification that the workspace posts before the machine goes to sleep.

NSWorkspaceScreensDidSleepNotification

A notification that the workspace posts when the machine’s screen goes to sleep.

NSWorkspaceScreensDidWakeNotification

A notification that the workspace posts when the machine’s screens wake.

NSWorkspaceAccessibilityDisplayOptionsDidChangeNotification

A notification that the workspace posts when any of the accessibility display options change.

NSWorkspaceVolumeLocalizedNameKey

A string containing the user-visible name of the volume.

NSWorkspaceVolumeURLKey

A URL containing the mount path of the volume.

NSWorkspaceVolumeOldLocalizedNameKey

A string containing the old user-visible name of the volume

NSWorkspaceVolumeOldURLKey

A URL containing the old mount path of the volume