Re: Appropriate dealloc and finalize actions
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