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.
views:
36answers:
1
+3
A:
Have a look at Technical Note TN2050 "Observing Process Lifetimes Without Polling"
Particularly the NSWorkspace notifications NSWorkspaceDidLaunchApplicationNotification
and NSWorkspaceDidTerminateApplicationNotification
Abizern
2010-07-12 12:27:20