Re: Retain cycle problem with bindings & NSWindowController
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.