Hi Mike.

How about having the main app periodically post a notification via 
NSDistributedNotificationCenter? The subtasks can observe the notification and 
terminate themselves if they don't receive one for some period of time.

-Jeff


On Mar 30, 2010, at 3:01 PM, McLaughlin, Michael P. wrote:

> I have a Cocoa app (Leopard) which launches several Foundation Tool subtasks
> (since threads are not sufficient in this case).  Currently, I terminate
> these subtasks via the app-delegate method
> 
> -(NSApplicationTerminateReply)applicationShouldTerminate:(NSApplication
> *)sender
> 
> This works provided one Quits the main app using the Quit menu item.
> However, if I force-quit or if I abort using the Stop icon in Xcode, then
> the main app terminates without terminating the subtasks.
> 
> Is there a more reliable hook (e.g., delegate method) that would always get
> called even on force-quit or Stop from Xcode so that these subtasks would
> always get terminated?  [Otherwise, I have to terminate them from Activity
> Monitor.]
> 
> Thanks.
> 
> -- 
> Mike McLaughlin

_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Reply via email to