Retain cycle problem with bindings & NSWindowController
Retain cycle problem with bindings & NSWindowController
- Subject: Retain cycle problem with bindings & NSWindowController
- From: "Dennis C. De Mars" <email@hidden>
- Date: Mon, 7 Jun 2004 00:33:15 -0700
OK, I've been beating my head against this problem all day, and I must
be doing something dumb because I haven't been able to find anything
with a search on the web and on this mailing list to indicate that
anyone else has a problem with this.
My question is: is it possible to use bindings when the nib "File's
Owner" is an NSWindowController subclass.
Using ObjectAlloc to diagnose memory leaks, it appears that my window
controller doesn't go away when the window is closed. It looks like the
extra retains are coming from the bindings. If I eliminate all
bindings, the window controller will go away when the window is closed.
It looks like the window will not be dealloced until the window
controller is dealloced, but the window controller is not dealloced
because the bindings are retaining it, so I have 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. However,
the available examples I've found so far use an NSDocument subclass as
the File's Owner. Of course, this is understandable for tutorial
examples. I'm still looking though, so if anyone can point me to a
working example where an NSWindowController subclass is used for the
File's Owner in a nib that uses bindings, I'd appreciate ti.
- Dennis D.
_______________________________________________
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.