Re: More bindings confusion
Re: More bindings confusion
- Subject: Re: More bindings confusion
- From: ScottAnguish <email@hidden>
- Date: Fri, 16 Jul 2004 02:59:17 -0400
On Jul 16, 2004, at 2:37 AM, Gwynne wrote:
On Jul 16, 2004, at 12:34 AM, Scott Anguish wrote:
for example, in a basic Cocoa Document application the Main.nib's
file owner is the instance of NSApplication. The Document.nib's
owner is the NSDocument subclass. There is no reason that you
couldn't load a nib and set a bindings
compliant controller (or model object) as the owner (and thus the
File's Owner).
So if I bind a view's "enabled" binding to Shared Application using
the model key path "delegate.kvcCompliantMethod", and implement
kvcCompliantMethod in the NSApplication delegate, it will work, but I
lose... what?
As I said, you shouldn't, you should use an object controller as an
intermediate.
an object controller knows when the document needs to get/abandon
changes, and is informed when the UI items change focus, which can
cause changes to be committed or abandoned.
always use an object controller. always always always.
Bindings are values, not actions. You can't actually trigger single
or double actions on an NSTableView with bindings. You can bind an
Action Invocation for Button and NSButtonCell, but not NSTableview
selections.
I can see where Action Invocation would be useful for NSTableView
though... if you think so, file an enhancement request at
bugreporter.apple.com
The fact that it can't be done is exactly my point :). Neither the
standard target/action for NSControl nor NSTableView's doubleAction
can be accessed with bindings.
NSControl no, NSButton/NSButtonCell, yes.
For that matter, you can't access doubleAction with traditional
outlets and connections either; it has to be done from code.
This isn't the only missing binding in IB; any NSButton should have
an Action Invocation binding, but you can't access it for a checkbox
or radio button.
That's true, because they are bound to values and those values then
take their new value from the checkbox or radiobutton group. It's a
different way of doing things from the conventional. There is no
reason that you can't still use plain old target/action in addition to
bindings. It's not intended to replace it in every case.
The power of bindings is being sabotaged here.
Not really, especially in the case in the checkbox/radiobutton.
I can hope this is fixed in Tiger, but in the meantime I'm going to
file a bug.
Thanks!
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.