NSOutlineView retention of items
NSOutlineView retention of items
- Subject: NSOutlineView retention of items
- From: john terranova <email@hidden>
- Date: Fri, 01 Mar 2002 15:08:56 -0800
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?
Thanks for your help.
--
john terranova, email@hidden
"Some people want everything in the whole wide world.
I want a whole lot more." -- Todd Snyder, "A Lot More"
_______________________________________________
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.