On 2009 Mar 04, at 11:39, James Walker wrote:

* Add an NSMutableIndexSet* member to my controller, to store the selection.
* Add KVO-friendly accessors for that index set.
* Update the index set (using the setter) in the outlineViewSelectionDidChange: delegate method.

James, you've added an instance variable which is simply a copy of other data. This is always a dangerous practice that must be exercised with great care. Although this practice is occasionally necessary for performance reasons, other alternatives should be considered first. In my judgment, getting KVObservability for a variable is not a enough good reason.

Maybe you'll be able to get away with it this time, because it's just an index set, but don't make a habit of this. If you ever try this with, for example, Core Data managed objects, you'll be spending some time bug-hunting.

I'm sticking with my method.

_______________________________________________

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