Re: Using bindings to make an NSPopupButton to assign an array filter predicate
Re: Using bindings to make an NSPopupButton to assign an array filter predicate
- Subject: Re: Using bindings to make an NSPopupButton to assign an array filter predicate
- From: Matt Neuburg <email@hidden>
- Date: Mon, 18 Dec 2006 15:08:58 -0800
- Thread-topic: Using bindings to make an NSPopupButton to assign an array filter predicate
On Mon, 18 Dec 2006 10:58:15 -0800, James Farwell <email@hidden> said:
>Right you are. Since all the basic bindings tutorials I had read
>were covering table views I made the mistake of assuming that all the
>behind-the-scenes magic that occurs when you bind a table view column
>to a controller (which must somehow set up a reverse binding so that
>the controller can observe the table view's selection changes) also
>worked for popup buttons.
I must stress, as I have often done in the past, that the first step in a
decent understanding of bindings is to expunge the word "magic" from one's
conceptual vocabulary. Nothing magical or mysterious happens.
It is true that when you bind an NSTableColumn's value to an
NSArrayController, it is effectively the NSTableView itself that ends up
bound to the NSArrayController's arrangedObjects (the content),
selectionIndexes, and sortDescriptors. (I say "effectively" because in fact
there is an intermediate NSTableBinder object.) But that isn't magic - it's
more like a convenient shorthand.
It is also true that when you bind from an interface item or NSController,
it sets up KVO in both directions, since otherwise synchronization would not
result. But that isn't magic either; in fact, it's a slog (as you can see
from mmalc's GraphicsBinding example, which demonstrates the sort of thing
an interface item does in response in a bind: call).
Now, having said all that, if you think this material is inadequately
presented in the documentation, then please file a bug against it. Your
evaluation of the documentation's usefulness to a beginner will never be as
keen as when you are one! m.
--
matt neuburg, phd = email@hidden, <http://www.tidbits.com/matt/>
A fool + a tool + an autorelease pool = cool!
AppleScript: the Definitive Guide - Second Edition!
<http://www.amazon.com/gp/product/0596102119>
_______________________________________________
Cocoa-dev mailing list (email@hidden)
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