Re: Opposite of windowDidLoad
Re: Opposite of windowDidLoad
- Subject: Re: Opposite of windowDidLoad
- From: Charles Srstka <email@hidden>
- Date: Thu, 12 Jan 2017 13:41:59 -0600
> On Jan 12, 2017, at 12:53 PM, Quincey Morris <email@hidden> 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 (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