Re: NSArrayController and table column bindings retain/dealloc woes
Re: NSArrayController and table column bindings retain/dealloc woes
- Subject: Re: NSArrayController and table column bindings retain/dealloc woes
- From: Ken Thomases <email@hidden>
- Date: Tue, 18 Nov 2008 17:40:12 -0600
On Nov 17, 2008, at 6:00 AM, Keith Blount wrote:
Which leads me to the big difference in my project... The File's
Owner in my nib file is not an NSDocument or an NSWindowController,
but my own custom view controller (my app runs on Tiger and Leopard
so I can't use Leopard's new NSViewController - instead I rolled my
own back on Tiger). My custom view controller just holds onto the
top level nib objects and then releases them in -dealloc, as follows:
[...]
I am thinking that maybe NSDocument and NSWindowController do a bit
more than this and possibly somehow unbind everything so that these
retain problems are avoided. Is that the case?
Yes, NSWindowController has that special logic. Search for
NSWindowController in the AppKit release notes (both current and
older). There's also a mention of this special feature of
NSWindowController in the NSViewController overview (by way of saying
that NSViewController has the same special feature), if I recall
correctly.
And if so, does anybody know how?
Only Apple. The implementation doesn't seem simple and it's
definitely not public.
I'd be very grateful if anyone can give me some advice on how to go
about resolving these issues...
This issue just came up on the list in the last month or so. You
could search the archives for a solution used by others. My
recommendation was to base your custom view controller on
NSWindowController, even if you don't connect its "window" outlet or
otherwise use it to control a window per se. And then, of course, let
the NSWindowController machinery load the nib, too.
Cheers,
Ken
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden