Re: How can an object know when another object has gone away?
Re: How can an object know when another object has gone away?
- Subject: Re: How can an object know when another object has gone away?
- From: "Hamish Allan" <email@hidden>
- Date: Mon, 16 Jun 2008 00:04:06 +0100
On Sun, Jun 15, 2008 at 11:20 PM, James W. Walker <email@hidden> wrote:
> Here's my specific situation. I have several controllers that can create
> tasks, using an NSTask wrapper based on the Moriarty sample. When a task
> completes, it sends a message to the controller that created it. If the
> controller dies before the task completes, I'd like to abort the task. But
> I'd prefer not to have the controllers explicitly keep track of all their
> tasks.
I'm not sure I understand the problem, but presumably your controller
keeps a reference to your NSTask to keep it alive; if the controller
properly releases that reference when it is dealloced, the task will
be terminated when the controller "dies".
Hamish
_______________________________________________
Cocoa-dev mailing list (email@hidden)
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:
This email sent to email@hidden