On Jan 18, 2015, at 00:10 , Rick Mann <rm...@latencyzero.com> wrote:
> 
> I'm building a view that renders a bunch of objects (a drawing canvas). Some 
> of these render differently if the objects are selected. As I iterate through 
> the list of objects to render, I need to test if each one is selected.

It would be easier to test if each one is in the array controller’s 
“selectedObjects”.

However, I wouldn’t do that either. Given that the selection status of an 
object affects its appearance, I’d say it’s better to make it an explicit 
property of each selectable object. Otherwise, you’re forced to drag the array 
controller’s API into all of your drawing code.

As far as I’m concerned, an array controller is a piece of glue code, a 
necessary evil. Any reference to it in code is at best a disappointment, at 
worst a design failure.

_______________________________________________

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:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Reply via email to