Re: Bindings Basics: selections
Re: Bindings Basics: selections
- Subject: Re: Bindings Basics: selections
- From: mmalcolm crawford <email@hidden>
- Date: Sun, 29 May 2005 16:39:44 -0700
On May 29, 2005, at 2:50 PM, Niko Matsakis wrote:
I do not understand how a selection gets set in Core Bindings. [...]
I have seen several examples that have an NSTableView, and use the
selection in the table view to populate some other fields. This is
the default interface generated by Option-Dragging a Data Model
into IB, for example. Unfortunately, I just don't get how it works.
In this case, the "detail" fields which are being populated (that
contain the details of the current entry), always refer to the
array controller and use a path like "selection.xxx".
To understand what bindings are and how they work, read:
<http://developer.apple.com/documentation/Cocoa/Conceptual/
CocoaBindings/Concepts/WhatAreBindings.html>
then
<http://developer.apple.com/documentation/Cocoa/Conceptual/
CocoaBindings/Concepts/HowDoBindingsWork.html>
It's not clear to me how selection is set; [...] It must be that
the NSTableView automatically adjusts the selection of its Content
Set Array Controller through some means, because I can't find where
it's being asked to.
If you simply bind the value of a table column, the content,
selectionIndexes, and sortDescriptors bindings are established
automatically for you. When the user makes a selection in a view,
the view messages the controller to update the selection automatically.
if there are multiple NSTableViews using a given controller, for
example, whose selection is set? (or is the answer "don't do that")
Don't do that.
Does it work differently if it is a NSPopUpButton that is reading
from the array controller? Does it not set the selection? Can I
make it do so?
It works in fundamentally the same way.
mmalc
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden