• 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: Adding "Bindings"
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Adding "Bindings"


  • Subject: Re: Adding "Bindings"
  • From: mmalcolm crawford <email@hidden>
  • Date: Sun, 21 Dec 2003 14:41:21 -0800

On Dec 21, 2003, at 1:41 PM, Duncan Oliver wrote:

What exactly defines the binding options in the Binding Palette for each class? What defines
which attributes can be bound? Is there anyway to add to this list of attributes? Is it defined
using NSKeyValueCoding or some other protocol? I was hoping to subclass NSOutlineView so that I
could bind it's content to a custom Controller. Any help would be appreciated. Thanks.

This is covered in the documentation:
"Creating a new binding between a user interface element and a controller is typically done in Interface Builder. However there are times it must be done programmatically, such as when creating a binding between a controller and a view in different nib files.

NSView subclasses can expose additional key-value-coding compliant properties as bindings by calling the class method exposeBinding: for each of the properties. This is typically done in the classs initialize method."
<http://developer.apple.com/documentation/Cocoa/Reference/ ApplicationKit/ObjC_classic/Protocols/NSKeyValueBindingCreation.html>

Note, though, that this is basically "just" a convenience so that you can establish bindings in IB. You can establish them programatically using -bind:toObject:withKeyPath:options:.

I've put together an example:
<http://homepage.mac.com/mmalc/CocoaExamples/ManualBindings.zip>

See also <http://homepage.mac.com/mmalc/CocoaExamples/controllers.html>

mmalc
_______________________________________________
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.

References: 
 >Adding "Bindings" (From: Duncan Oliver <email@hidden>)

  • Prev by Date: Adding "Bindings"
  • Next by Date: Re: with java - create, read from, write to preferences file
  • Previous by thread: Adding "Bindings"
  • Next by thread: [anOpenPanel filename] won't work after XCode 1.1 update
  • Index(es):
    • Date
    • Thread