Re: Custom NSView binding
Re: Custom NSView binding
- Subject: Re: Custom NSView binding
- From: Quincey Morris <email@hidden>
- Date: Tue, 01 Nov 2011 12:16:46 -0700
On Nov 1, 2011, at 11:54 , Livio Isaia wrote:
> I created an IB plug-in with a subclass of NSView with an exposed bind of type NSNumber, and then I bind it to a MyNSImageView through an NSObjectController (this is made directly in IB).
> Now, everything works fine, except that when the method setSelectedIndex: from MyClass is called the bound NSImageView doesn't receive any change notification.
> Can anyone tell me why?
Based on the information you've given us:
You *exposed* (i.e. declared) a binding called "type", but you haven't *implemented* that binding.
So, when you establish the particular binding relationship from a MyClass object to a MyNSImageView object, the automatic KVO portion of the binding (changes to the MyNSImageView object get pushed back to the MyClass object) works, but the part you're supposed to provide (pushing changes from the MyClass object to the MyNSImageView object) doesn't.
In other words, if you don't provide any code for the binding, it'll sort of appear to work, but *in one direction only*.
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden