On Oct 11, 2009, at 4:11 PM, Greg Guerin wrote:

Why would you do this? You're making one object responsible for the internals of another object. This is a bad idea. It breaks the individual encapsulation of each object.

But there are times you need to do this. One example is in some teardown situations with NSWindowControllers — I've sometimes had to clear the window's delegate property to avoid the window trying to message the controller after it's been torn down.

It's not so much making an object responsible for another object's internals, as simply managing a relation from that other object. In other words, I'm the one who told the window to point its delegate property to me, so it's OK for me to tell it to point it to nil when I go away.

—Jens_______________________________________________

Cocoa-dev mailing list ([email protected])

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 [email protected]

Reply via email to