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: Keith Blount <email@hidden>
- Date: Thu, 20 Nov 2008 12:36:19 -0800 (PST)
Thanks for your reply, Ken. I did search the archives (and other places to) but didn't see the recent discussion you mentioned, so I must have missed it. The window controller method isn't a great solution for me, unfortunately - I tried it but it causes all sorts of responder issues given how deep my own view controllers are already embedded into my app. The main thing is knowing that this is all handle automatically by NSWindowController, NSViewController and NSDocument, though - knowing that gives me the way forward, as it tells me that I haven't got anything horrible going on but that I just need to unbind certain table columns manually. As I only use my custom view controller in a few places, it shouldn't be too onerous to hard code this for now.
Many thanks again for your help, much appreciated.
All the best,
Keith
--- On Tue, 11/18/08, Ken Thomases <email@hidden> wrote:
> From: Ken Thomases <email@hidden>
> Subject: Re: NSArrayController and table column bindings retain/dealloc woes
> To: email@hidden
> Cc: email@hidden
> Date: Tuesday, November 18, 2008, 11:40 PM
> 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