Re: Adding "Bindings"
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.