• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
How can an object know when another object has gone away?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

How can an object know when another object has gone away?


  • Subject: How can an object know when another object has gone away?
  • From: "James W. Walker" <email@hidden>
  • Date: Sun, 15 Jun 2008 15:20:39 -0700

Is there a standard Cocoa design pattern or idiom to have an object find out when another object has been destroyed? In PowerPlant, I'd use LBroadcaster and LListener, with the listener listening for msg_BroadcasterDied.

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.
_______________________________________________


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


  • Follow-Ups:
    • Re: How can an object know when another object has gone away?
      • From: "Hamish Allan" <email@hidden>
    • Re: How can an object know when another object has gone away?
      • From: Andreas Monitzer <email@hidden>
  • Prev by Date: Re: NSMutableAttributedString's setBaseWritingDirection problem
  • Next by Date: Re: How can an object know when another object has gone away?
  • Previous by thread: Re: NSMutableAttributedString's setBaseWritingDirection problem
  • Next by thread: Re: How can an object know when another object has gone away?
  • Index(es):
    • Date
    • Thread