tig
tig

Reputation: 27790

Observe other application quit or sudden termination in cocoa app

I need to create wrapper around application, so I created little cocoa app that opens application with [[NSWorkspace sharedWorkspace] launchApplication:…], can I register some event when that application quits or terminates (I certainly need to get event if app is finished good or bad way). I know that I can ask if such application is running every second, but I hope that there is a better way.

Upvotes: 2

Views: 717

Answers (1)

Abizern
Abizern

Reputation: 150615

Have a look at Technical Note TN2050 "Observing Process Lifetimes Without Polling"

Particularly the NSWorkspace notifications NSWorkspaceDidLaunchApplicationNotification and NSWorkspaceDidTerminateApplicationNotification

Upvotes: 5

Related Questions