• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: More bindings confusion
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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.


  • Follow-Ups:
    • Re: More bindings confusion
      • From: Allan Odgaard <email@hidden>
    • Re: More bindings confusion
      • From: Gwynne <email@hidden>
References: 
 >More bindings confusion (From: Gwynne <email@hidden>)
 >Re: More bindings confusion (From: Scott Anguish <email@hidden>)
 >Re: More bindings confusion (From: Gwynne <email@hidden>)

  • Prev by Date: Re: More bindings confusion
  • Next by Date: Getting progress of WebView load
  • Previous by thread: Re: More bindings confusion
  • Next by thread: Re: More bindings confusion
  • Index(es):
    • Date
    • Thread