Re: NSOutlineView
Re: NSOutlineView
- Subject: Re: NSOutlineView
- From: Quincey Morris <email@hidden>
- Date: Wed, 10 Sep 2014 01:25:34 +0000
On Sep 9, 2014, at 17:45 , Charles Jenkins <email@hidden> wrote:
> My question is: assuming that my Document class is indeed acting as the outline view’s delegate, which of these graphical objects is supposed to be the one calling outlineView:objectForTableColumn:byItem:?
That’s a data source method, not a delegate method. I wonder if you accidentally left the outline view’s dataSource connection unconnected at some point in your XIB editing.
> Isn’t that the one where I should mess with bindings?
No, there are two kinds of bindings that may be relevant to a table view.
1. You can bind the table view’s content to something that supplies ‘objectValue’ objects. This relieves you of the need to use the data source method we’re discussing in this thread. However, for my money, this binding is a waste of time (and a mere source of obfuscation). It’s easier to either:
1a. Implement ‘outlineView:objectForTableColumn:byItem:’, or
1b. Set the “objectValue” property directly when creating the cell view.
This kind of binding is unrelated to what we’re discussing in this thread.
2. You can bind values of controls/subviews within each table cell view *through* the table cell view’s “objectValue” property. This is basically a per-row “prototype” of the actual bindings that the table view will establish for you at run time.
This kind of binding — which as you saw is directly supported in IB by the “table cell view” item in the binding popup — is the easiest way to get values into your table cell view subviews. If you don’t do it that way, your cell view creation delegate method would have to have code to set the values directly on the view’s subviews and controls.
I hope that’s expressed clearly. The terminology is a bit generic in this area, so it’s easy to be unclear.
_______________________________________________
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