• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: NSTableView not retaining its data source. What to do?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: NSTableView not retaining its data source. What to do?


  • Subject: Re: NSTableView not retaining its data source. What to do?
  • From: Dan Bernstein <email@hidden>
  • Date: Mon, 19 Nov 2001 09:39:49 +0200

On Monday, November 19, 2001, at 06:07 AM, Brian Webster wrote:

Are you releasing the drawer? When you load a nib file, you (i.e. the file's owner) are responsible for releasing all of the top level objects.

As I said, "I" am a NSWindowController subclass, and according to the docs, "...the window controller is responsible for freeing all top-level objects in the nib file it loads", and "As a consequence of autoreleasing itself, a NSWindowController autoreleases its window as well as all all other top-level objects in its nib file".

All of the subviews of the top level windows and drawers are released automatically, but only when you release the top level object. If you don't release the drawer, the NSTableView it contains won't be deallocated and thus will continue to exist and attempt to access its data source. I think. :)

My guess is that the NSTableView does get released eventually (but I'd have to subclass it, override dealloc and set a breakpoint there to find out) but that it happens only on the next iteration of the run loop.

Anyway, as of now I seem to be unable to reproduce the bug (it only happened under certain circumstances in the first place), but it still bothers me.

--
Dan Bernstein


References: 
 >Re: NSTableView not retaining its data source. What to do? (From: Brian Webster <email@hidden>)

  • Prev by Date: loading a Nib in Java
  • Next by Date: Drawer in Drawer
  • Previous by thread: Re: NSTableView not retaining its data source. What to do?
  • Next by thread: NSTask interaction
  • Index(es):
    • Date
    • Thread