Re: binding an array controller to columns in an NSTableView
Re: binding an array controller to columns in an NSTableView
- Subject: Re: binding an array controller to columns in an NSTableView
- From: Erik Stainsby <email@hidden>
- Date: Tue, 11 Sep 2012 14:05:50 -0700
I keep wondering as I'm watching this thread if it might be easier and more closely match the extensibility of the "row of color views" Chuck is trying to create if he were to use an NSMatrix instead of the full blown NSTable ?
Sent from my iCapsule somewhere in orbit
On 2012-09-11, at 11:23 AM, Quincey Morris <email@hidden> wrote:
> On Sep 11, 2012, at 10:13 , Chuck Soper <email@hidden> wrote:
>
>> When adding additional colors, I understand that the following code can
>> create a color object, but I'm not sure where to put this code or if I can
>> use bindings instead.
>> NSManagedObject *color = [NSEntityDescription
>> insertNewObjectForEntityForName:@"Color"
>> inManagedObjectContext:self.managedObjectContext];
>> [color setValue:@"Dark Blue" forKey:@"name"];
>
> Where you put this code will depend on what triggers creation of the color object. If, for example, there's a button that's clicked to create a color, then you'd probably have an action method in a controller (e.g. window controller, view controller or app delegate) that's responsible for creating the new color object. This might contain the above code, or if it's a bit more complicated it might call a data-model method that creates the color object with all its properties set properly.
>
>> Essentially, I want each "color" object to be a bindable custom view.
>> Ideally, this custom view would be a NSTableCellView subclass. My table
>> would always have a single row, so I misspoke when I described that as a
>> column. I'm not sure how I create and remove this view when creating and
>> removing color objects.
>
> I'm not sure what you mean by "a single row" here. The table only ever has one row? Or are you saying there should be multiple color subviews in each row?
>
> Perhaps it would be clearer if you asked the whole question again -- I'm a little unsure what you're asking.
>
>
> _______________________________________________
>
> 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
_______________________________________________
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