Re: NSWindowController with NSObjectController doesn't dealloc
Re: NSWindowController with NSObjectController doesn't dealloc
- Subject: Re: NSWindowController with NSObjectController doesn't dealloc
- From: Shaun Wexler <email@hidden>
- Date: Mon, 11 Oct 2004 10:52:50 -0700
On Oct 11, 2004, at 9:51 AM, Peter Schmidt wrote:
I have subclassed an NSWindowcontroller class, wich is initialized by
the [myController initWithNibName: @"MyWindow"] Method. In the
Nib-File is an NSArrayController, wich is bound to some UI-Elements.
If I send the WindowController the close-Message my dealloc-Method
won't be called. If I remove the ArrayController it works perfect. It
seems the NSArrayController is still bound to the contentArray. All
bindings are made in the IB. There is no Outlet to the
NSArrayController.
What do I wrong?
You are experiencing a glaring bug in Cocoa bindings and/or
NSArrayController and IB. Sorry, but this affects us all. If you bind
anything thru File's Owner (if it is the NSWindowController). The
workaround is to use a different object as File's Owner, such as an
NSDocument subclass, or a category on NSApplication as glue. What I do
is to have the document create a window controller in
-makeWindowControllers, with self as owner. All IB outlets are in the
document's header, and you must pass them to the window controller via
accessor methods, or an array, etc. This becomes increasingly
inconvenient with large numbers of outlets, and especially problematic
with multiple window controllers, effectively trashing the benefits of
the document architecture. The final solution: don't use bindings,
until Apple fixes this huge bug, or leak like crazy.
--
Shaun Wexler
MacFOH
http://www.macfoh.com
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden