• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Retain cycle problem with bindings & NSWindowController
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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.


  • Prev by Date: Re: / NSFileHandle in rtf and mpg files /
  • Next by Date: Re: Panther's NSScreen vs. screen resolution changes
  • Previous by thread: Re: Retain cycle problem with bindings & NSWindowController
  • Next by thread: Radio Buttons and Binding
  • Index(es):
    • Date
    • Thread