• 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: Scott Anguish <email@hidden>
  • Date: Fri, 16 Jul 2004 00:34:17 -0400

On Jul 16, 2004, at 12:08 AM, Gwynne wrote:

In Interface Builder, you can make bindings to File's Owner without setting up a controller first. Aside from perhaps the model key path, what is the difference between binding directly to File's Owner, and creating an NSObjectController connected to File's Owner and binding to that? (Assuming that it's a singular object and that the File's Owner is what you want to bind to). What does NSController do that a direct binding does not? And if NSController does do something special, why is binding directly to File's Owner (or to Shared App) allowed at all?

NSController supports the NSEditor/NSEditorRegistration protocols. Without that items that don't immediately register their changes (like NSTextFields) don't work correctly.... also there can be issues when documents are saved.

> And why is there no documentation at all about these?

Actually, the docs talk about binding through controllers because that's how you're supposed to do it.

As far as File's Owner is concerned, this isn't specific to bindings at all. You can bind to File's Owner because it is proxy for some other object that may or may not support bindings. It's a basic (and difficult) first principle of multiple nib applications

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).


And on a side note, why is it that I can't bind to NSTableView's doubleAction? Obviously it's not exposed as a binding, but I tried exposing it by doing a subclass and an IB palette, and of course IB doesn't have the foggiest view that it's a multiple-value target-argument binding and there doesn't seem to be any way to tell it so. I smell nasty shortcomings in IB (big surprise).


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
_______________________________________________
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: Gwynne <email@hidden>
References: 
 >More bindings confusion (From: Gwynne <email@hidden>)

  • Prev by Date: More bindings confusion
  • Next by Date: Re: Cocoa Wantabe - need compression and encryption
  • Previous by thread: More bindings confusion
  • Next by thread: Re: More bindings confusion
  • Index(es):
    • Date
    • Thread