Re: NSOutlineView retention of items
Re: NSOutlineView retention of items
- Subject: Re: NSOutlineView retention of items
- From: Dan Waylonis <email@hidden>
- Date: Fri, 1 Mar 2002 18:49:53 -0800
On Friday, March 1, 2002, at 03:08 PM, john terranova wrote:
>
I'm a long time programmer, new to Cocoa. I have an IBAction
>
to delete an
>
item in an NSOutlineView, which is basically this:
>
>
- (IBAction)deleteRow:(id)sender
>
{
>
id rwItem = [m_tbl itemAtRow:[m_tbl selectedRow]];
>
>
if (rwItem != nil)
>
{
>
[m_tbl collapseItem: rwItem collapseChildren:YES];
>
[rwItem release];
>
[m_tbl reloadData];
>
}
>
}
>
>
I eventually figured out using ObjectAlloc that expanded items in
>
NSOutlineView get retained. The only way to remove an expanded
>
item from
>
the table is to first collapse the item, then release the item
>
so that my
>
dataSource won't find it anymore.
>
>
Without the collapseItem, the item does not appear to be
>
dealloc'd until the
>
table is dealloc'd, which may be a long time later.
>
>
Is this the proper way to remove (expanded) items from
>
NSOutlineView, or am
>
I missing something?
Hi John,
It's a known (to Apple) AppKit bug.
You have to make sure that all outline view items are collapsed
when you're done with the view.
Dan
__________________________________________________________________
Dan Waylonis email@hidden
Software Engineer
http://www.nekotech.com
nekotech SOFTWARE 650.964.2490 (O)
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.