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 (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