Re: Retain cycle problem with bindings & NSWindowController
Re: Retain cycle problem with bindings & NSWindowController
- Subject: Re: Retain cycle problem with bindings & NSWindowController
- From: Shaun Wexler <email@hidden>
- Date: Tue, 8 Jun 2004 13:41:43 -0700
On Jun 8, 2004, at 2:46 AM, Allan Odgaard wrote:
On 8. Jun 2004, at 11:06, Dennis C. De Mars wrote:
So, even in this simplest of examples the NSWindowController object
is caught in a deadly embrace with the view object binding to it,
which the NSDocument seems to be able to break.
The problem I had did involve NSDocument, but I do think that a window
controller is more susceptible to the retain-cycle problem.
My solution was to send unbind: messages in the
windowWillClose:-notification.
I believe that the NSWindowController won't be released until
NSApplication selects a different main window (or key window?), if the
closed window in question was the only visible window at the time.
Moving the cursor over a visible (non-key) utility window also triggers
the release. Closing the window does release/remove its subviews,
caches & backing store, but the window object itself is still being
retained by NSApp somewhere. I'm in total agreement about IB and
excessive retaining of bound objects, though...
--
Shaun Wexler
MacFOH
http://www.macfoh.com
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.