Re: NSOutlineView: expanding an item retains it?
Re: NSOutlineView: expanding an item retains it?
- Subject: Re: NSOutlineView: expanding an item retains it?
- From: Clark Cox <email@hidden>
- Date: Sat, 22 Jan 2005 09:29:48 -0500
When an NSOutlineView has an expanded item, it needs to hold onto that
item so that it can come back and ask you for its sub-items. If it
didn't retain it, then how could it reliably do that?
On Fri, 21 Jan 2005 21:44:55 -0800, Steve Mykytyn
<email@hidden> wrote:
> Has anyone else run across this?
>
> While dealing with a knotty retain problem in an NSDocument-based app I
> noticed that NSOutlineView appears to retain any expanded items.
>
> This retain is not mentioned in the docs AFAIK, and I would not have
> noticed had I not introduced a very subtle bug of my own that caused me
> to look closely at the dealloc sequencing using MallocDebug. Should it
> be this way?
>
> You can see the retain by closing an NSDocument whose main view has an
> NSOutlineView with some expanded items. While releasing all my
> document objects, I noticed that some didn't get dealloc until after
> the NSDocument was done with its dealloc. Using NSLog() to trace the
> output (heavily edited) looks like:
>
> [NSDocument dealloc] ---> entered
>
> ... most of my data objects are receive dealloc immediately
>
> [NSDocument dealloc] --->[super dealloc]
> [NSDocument dealloc] ---> exited
>
> (presumably the window gets released here, causing it to release its
> views)
>
> [myMainView dealloc]
>
> NSMutableArrays that corresponded to the top-level items in the
> NSOutlineView receive dealloc here, rather than above, IF the
> corresponding row in the NSOutlineView is expanded.
>
> Although this SEEMS harmless, I wonder. Everything runs OK now in my
> app even if it gets dealloc a little late.
>
> _______________________________________________
> 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
>
--
Clark S. Cox III
email@hidden
http://www.livejournal.com/users/clarkcox3/
http://homepage.mac.com/clarkcox3/
_______________________________________________
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