Re: Using an arraycontroller for different object classes
Re: Using an arraycontroller for different object classes
- Subject: Re: Using an arraycontroller for different object classes
- From: Ken Thomases <email@hidden>
- Date: Sat, 16 May 2009 20:45:59 -0500
On May 15, 2009, at 11:47 PM, Gideon King wrote:
In the mini example, yes I would want the object array for weight to
have the full array, and the object array for the tyre size to have
the filtered array, and as you say, this could be accomplished with
separate controllers. However, this means that for every different
type of object in my application that is visible in the inspectors
(currently we have 9 different classes affected), I would have to
have a different array controller, and where there is a subset of
common attributes across different objects, I would have to have
additional array controllers. I could quite easily end up with 20
array controllers just to handle it, and I would have to make sure
the bindings were made to the right one that represented the objects
which were applicable to that particular key.
You have misunderstood my suggestion (or I've misunderstood what
you're trying to achieve).
You don't need a different array controller for every different type
of object. You just need two array controllers. One which is
unfiltered, for any views which show all of the objects. Another
which is filtered by a predicate, for the inspector. You would
dynamically change the filter on the second array controller based on
how the inspector is configured. If it's configured to show a tire
size, the code which configured it that way would also set the filter
on the array controller to restrict its contents to objects with tires.
Regards,
Ken
_______________________________________________
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