• 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: Allan Odgaard <email@hidden>
  • Date: Mon, 7 Jun 2004 19:29:16 +0200

On 7. Jun 2004, at 9:33, Dennis C. De Mars wrote:

My question is: is it possible to use bindings when the nib "File's Owner" is an NSWindowController subclass.

I have this problem as well (and did mention it a few times on this list w/o responses ;) ).

The documentation for addObserver:forKeyPath:options:context: says that "Neither the receiver or anObserver are retained", so it should not happen solely by having the view observe the controller/model.

But the documentation for bind:toObject:withKeyPath:options: does not make such a guarantee, and surely, it is only some bindings which cause a retain cycle.

I don't see any way to specify the path to the model property for a binding except through the File's Owner, so it looks like the File's Owner can't be the window controller. But that can't be right.

I hope you'll report it as a bug -- I haven't come around to doing that myself yet, so many bugs, so little time, and so little incentive to do so ;)

However, the available examples I've found so far use an NSDocument subclass as the File's Owner [...]

Unfortunately that won't solve anything.

Document retains window controller,
window controller retains top level nib objects,
top level nib objects retain children,
children retain document (because of bindings),

-> and there's your cycle again!
_______________________________________________
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.


  • Follow-Ups:
    • Re: Retain cycle problem with bindings & NSWindowController
      • From: "Dennis C. De Mars" <email@hidden>
References: 
 >Retain cycle problem with bindings & NSWindowController (From: "Dennis C. De Mars" <email@hidden>)

  • Prev by Date: Re: NSDictionary design bug (was: Re: Ugly bug in Foundation, beware!)
  • Next by Date: Re: GUI without IB
  • Previous by thread: Retain cycle problem with bindings & NSWindowController
  • Next by thread: Re: Retain cycle problem with bindings & NSWindowController
  • Index(es):
    • Date
    • Thread