• 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
Re: Appropriate dealloc and finalize actions
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Appropriate dealloc and finalize actions


  • Subject: Re: Appropriate dealloc and finalize actions
  • From: Jens Alfke <email@hidden>
  • Date: Mon, 12 Oct 2009 08:25:46 -0700


On Oct 12, 2009, at 4:26 AM, Karolis Ramanauskas wrote:

As you can see each box has one or more little "inputs" and "outputs" in
fact these inputs and outputs are instances of one class (KROMPort). When I
drag a connection from output to an input, I set each "port's" connection
property to point to another "port". So Input points to Output and Output
points to Input. Only one-to-one relationships are allowed (one connection
per input/output).

It's best not to do this kind of cleanup in dealloc/finalize. Instead, have an explicit method like -disconnect that's called to remove the object from the graph. That way you're in direct control of removing objects. And yes, when [foo disconnect] is called it will need to tell its connected object to clear the connection to itself.


—Jens

_______________________________________________

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: Appropriate dealloc and finalize actions
      • From: Chris Hanson <email@hidden>
References: 
 >Re: Appropriate dealloc and finalize actions (From: Greg Guerin <email@hidden>)
 >Re: Appropriate dealloc and finalize actions (From: Karolis Ramanauskas <email@hidden>)
 >Re: Appropriate dealloc and finalize actions (From: Kai Brüning <email@hidden>)
 >Re: Appropriate dealloc and finalize actions (From: Karolis Ramanauskas <email@hidden>)

  • Prev by Date: Re: TIFFRepresentation, different TIFF format under Snow Leopard
  • Next by Date: Re: TIFFRepresentation, different TIFF format under Snow Leopard
  • Previous by thread: Re: Appropriate dealloc and finalize actions
  • Next by thread: Re: Appropriate dealloc and finalize actions
  • Index(es):
    • Date
    • Thread