Re: associating a custom view for each object in a core data entity
Re: associating a custom view for each object in a core data entity
- Subject: Re: associating a custom view for each object in a core data entity
- From: Chuck Soper <email@hidden>
- Date: Tue, 11 Sep 2012 17:50:22 -0700
- Thread-topic: associating a custom view for each object in a core data entity
On 9/11/12 4:36 PM, "Quincey Morris" <email@hidden>
wrote:
>On Sep 11, 2012, at 15:54 , Chuck Soper <email@hidden> wrote:
>
>> I want every color object to be associated with a custom view. All the
>> color views for a given house need to be presented as a horizontally
>> scrolling list. I also need drag and drop functionality to change the
>> order of the colors in the list. I think I could use a view based table
>> with one row with the number of columns equal to the number of colors.
>> Does this sound like a reasonable approach?
>
>I don't think NSTableView has got anything that will help with this. The
>nearest you're going to get is column reordering (with columns you've
>created in code), but this means you'll need to have column header shown
>to enable dragging, and dragging the header will re-order every row.
Thanks for your advice. I'm now thinking that an NSScrollView with a list
of custom views should be quite straightforward.
>> Whenever a color object is added or removed (from a house), I'll need to
>> create or remove the associated custom color view. I'm not certain where
>> the code (or binding) to create or remove the custom view for each color
>> object should go.
>
>Either the parent view or the parent view's (view or window) controller
>can KVO-observe the "colors" property in the data model, and adjust the
>contents of the view as necessary.
I'm glad that you mentioned this. I believe that I can also bind an
NSArrayController to the core data entity, then KVO-observe the
arrangedObjects property. Thanks!
Chuck
_______________________________________________
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