> On Jan 12, 2017, at 12:53 PM, Quincey Morris 
> <quinceymor...@rivergatesoftware.com> wrote:
> 
> windowWillClose is an acceptable place to tear down the binding only if (a) 
> the thing bound, and the thing bound to, still exist, and (b) there is no 
> chance that the window will be re-opened. Both of those are typically true, 
> but it does depend on what you’re doing.
> 
> Window dealloc/deinit is also a possible time, but again you need to be sure 
> that the relevant objects still exist, probably by keeping strong references 
> to them in the window controller itself (and again it depends on what you’re 
> doing).

The nice thing about windowWillClose for this is that if the binding ends up 
retaining your window controller somehow, you don’t end up with a retain cycle.

Charles

_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

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:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Reply via email to