Re: Custom binding to NSArrayController fails
Re: Custom binding to NSArrayController fails
- Subject: Re: Custom binding to NSArrayController fails
- From: Justin Anderson <email@hidden>
- Date: Tue, 14 Mar 2006 21:38:25 -0500
The documentation for the "selection" binding says it returns:
"A proxy object representing the receiver’s selection. This object is
fully key-value coding compliant, but note that it is a proxy and so
does not provide the full range of functionality that might be
available in the source object."
So either switch to using -valueForKey:@"name" instead of calling -
name directly, or grab the actual object from the controller with
[[controller selectedObjects] objectAtIndex:0].
<http://www.cocoabuilder.com/archive/message/cocoa/2006/2/27/157553>
Justin Anderson
http://www.tensaimac.com/
On Mar 14, 2006, at 4:01 PM, Ben Lachman wrote:
I am trying to get a bit more into bindings. I have a proof of
concept app I've been working on that I am integrating some custom
bindings into. In the app there is a table that is filled in via
bindings with the name variable from objects in an array in my app
controller. This works great and is really simple. Next I wanted
to set a 'selectedItem' variable in my app controller using
bindings as well. I implemented the custom bindings just like in
the sample BindingsJoystick. However, when I try to bind my
controller 'selected' key to the NSArrayContoller's 'selection' I
get this exception when calling [super
bind:toObject:withKeyPath:options] at the end of my custom bind
method:
2006-03-14 15:38:45.215 CustomView[2656] Cocoa Bindings: Error
setting value for bound property selected of object
<NSKVONotifying_RVController: 0x34a4a0>: *** -
[_NSControllerObjectProxy name]: selector not recognized [self =
0x35a3e0]
Any ideas what I might be doing wrong?
Thanks,
->Ben
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden