Re: Release mode bindings crash and release pools
Re: Release mode bindings crash and release pools
- Subject: Re: Release mode bindings crash and release pools
- From: Charles Srstka <email@hidden>
- Date: Fri, 16 Jun 2017 15:48:22 -0500
> On Jun 16, 2017, at 3:27 PM, Jerome Krinock <email@hidden> wrote:
>
>> On 2017 Jun 16, at 10:35, Quincey Morris
>> <email@hidden
>> <mailto:email@hidden>> wrote:
>>
>> it takes additional custom code (like in the joystick example) to implement
>> the other direction. At least, that’s what I’ve been saying for years,
>> though I don’t think I’ve ever found a developer who believes me.
>
> I believe you. I think it was on your advice I've done this:
>
> foo.bind("xxx", to: bar, ... );
> bar.bind("yyy", to: foo, ... );
>
> It works, but only in both directions with both statements.
This is incorrect. The recommended way to implement a two-way binding is to
override .bind(…) on the target object and set up KVO observations there. See
this page in the docs:
https://developer.apple.com/library/content/documentation/Cocoa/Conceptual/CocoaBindings/Concepts/HowDoBindingsWork.html
<https://developer.apple.com/library/content/documentation/Cocoa/Conceptual/CocoaBindings/Concepts/HowDoBindingsWork.html>
Charles
_______________________________________________
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