Re: NSOutlineView doesn't flush cache?
Re: NSOutlineView doesn't flush cache?
- Subject: Re: NSOutlineView doesn't flush cache?
- From: Brian Webster <email@hidden>
- Date: Fri, 14 Jun 2002 15:17:11 -0500
On Friday, June 14, 2002, at 01:04 PM, Matt Neuburg wrote:
On Wed, 12 Jun 2002 14:02:43 -0500, Brian Webster
<email@hidden> said:
This works fine, but it's exhibiting a rather strange behavior.
First I select one set of data to display and twist down some
triangles in the outline. Then I select a second set of data,
and it displays fine. Then, I switch back to the first set of
data, but the triangles are twisted down for the same objects
they were last time. Furthermore, if I have two sets of data
that share the same object, twisting down the triangle for a
given object in one set will cause that some object to be
twisted down when displaying the other set.
From what I can tell, the problem is that the outline view is
keeping an internal cache of these items
I don't think it's the items that NSOutlineView is caching; it's the
expansion state of particular rows. In many contexts this is a
good thing.
Where it isn't, you can just set the expansion state yourself.
I'm sorry to
be vague, but I'm still working on an implementation for this
myself. m.
I thought it might be saving row-based expansion states except
that it doesn't save expansion state on a row by row basis when
switching between sets of data. For example, if set A has items
X, Y, and Z with Y pulled down, switching to set B with items P,
Q, and R doesn't result in Q being pulled down. But, switching
to set C that has items Y, R, and X will resulting in Y being
pulled down, even though it's in a different row than before.
This actually would be a good behavior if the items being
displayed weren't shared between the sets, but expanding an item
in one set shouldn't affect the display of that item in another
set.
I found a partial fix in which I simply tell the the outline to
collapse all of its root level items before switching between
sets. Telling it to collapse each item's children as well
should result in a total fix, except for a bug in NSOutlineView
in which the second argument to collapseItem:collapseChildren:
is ignored, so it only works WRT the expansion of the root level
items.
--
Brian Webster
email@hidden
http://homepage.mac.com/bwebster
_______________________________________________
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.