Re: A TableView Binding question
Re: A TableView Binding question
- Subject: Re: A TableView Binding question
- From: Quincey Morris <email@hidden>
- Date: Tue, 22 Feb 2011 21:11:18 -0800
On Feb 21, 2011, at 23:58, Motti Shneor wrote:
> I can't get this to work --- because I don't know what to write in the binding of the TableColumn. It seems there is no way to say "Just the entity" within IB's window.
>
> I select the table column.
> I Bind to: ArrayController
> I set the Controller key to: arrangedObjects
> and now... I don't know what to write in the "Model Key Path" field.
>
> I guessed and tried the following values, to no avail. I always get a binding error:
>
> 1. Leave the "Model key path" field blank
> 2. self
> 3. @self
> 4. SELF
> 5. @SELF
> 6. @""
> 7. @
The correct answer is #2: self. What's the "binding error" when you use that? Are you talking about an error in IB or a runtime error?
> I believe something is missing in the visual description in IB. when you bind against the arrangedObjects of the ArrayController, you actually indirectly specify that the array controller instantiates some Enumerator (Iterator) and the Model Key Path is applied to that enumerator. But what key-path do you ask from enumerator to bring back itself?.
It is a little funky, because IB shows the binding textually as ArrayController.arrangedObjects.x.y.x, but there's no actual key path like that. (An array property is illegal in the middle of a key path.) Instead, there are two key paths -- ArrayController.arrangedObjects and x.y.z -- and it's the internal implementation of the Table Column "value" binding that bridges between the array represented by the first path and the specific array element needed by the second.
_______________________________________________
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