Re: NSArrayController Conceptual Problem
Re: NSArrayController Conceptual Problem
- Subject: Re: NSArrayController Conceptual Problem
- From: Quincey Morris <email@hidden>
- Date: Thu, 14 Jan 2010 12:36:48 -0800
On Jan 14, 2010, at 12:10, Richard Somers wrote:
> I have a Core Data document based application. In the data model there are five entities.
>
> Currently I have a inspector panel with five NSArrayControllers, one for each entity. The panel works well but currently all user interaction is confined to the panel itself.
>
> The primary user interface however is a custom view where the model objects are presented to the user all mixed up and in random locations like in a graphics application. The user needs to select one of these objects and then do something with it.
>
> Here is the issue. There is a tension between the inspector panel and the primary view. The inspector panel wants one array controller per entity. The primary view wants a single array controller.
>
> A single array controller would work great for selection in the primary view. But how would you get one array controller to work for five entities?
>
> Multiple array controllers works great for the inspector but the primary view would need query the selected object and then send a message to the proper array controller.
How about using a sixth array controller for the primary view? It would, of course, be in class mode, not entity mode, and would be bound to a NSArray of the other 5 controllers -- an immutable array property of (likely) your window controller, rather than your data model. Then the primary view would refer to its (single) array controller of interest as 'sixthArrayController.selection', while the inspector would continue referring to the other five array controllers directly.
You say nothing that suggests the inspector needs to know which is the selected item in the primary view, but if it needs to know it should be able to do so from 'sixthArrayController.selection', or something derived from it.
_______________________________________________
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