Re: Re: Getting an NSOutlineView Item's parent
Re: Re: Getting an NSOutlineView Item's parent
- Subject: Re: Re: Getting an NSOutlineView Item's parent
- From: "Alan Smith" <email@hidden>
- Date: Wed, 18 Oct 2006 16:47:19 -0400
Greetings,
Scott meant create a NSObject subclass that would suffice for your
needs. If you really do need both array and dictionary functionality,
and whatever else, you could make a class that contained one of each.
When you would allocate one of these special objects you could tell it
which of the contained objects to allocate. How ever you do it, the
point is you would have a weak reference to the objects parent.
Perrog's method could be extremely slow and I wouldn't use it. There
may be a case where the parent is very far "up" there and thus the
computation would be slow and CPU intensive. Also, I suspect that
isExpandable calls the data source method -
(BOOL)outlineView:(NSOutlineView*)outline isItemExpandable:(id)item so
this is another potential slow spot. It would be better to have a
direct link of some kind to the parent.
I have found that using a CFTree, or other like class, is perfect for
NSOutlineView data sources. I made my own but if you don't want to
search for JKPTree, it's a wrapper on CFTree.
I have found that trees are much cooler than it may seem and more
useful. When I made my tree class I thought that I'd only use it for
the project I was currently working on but I've used it since.
If you are still stuck I suggest that you tell us why you need so many
different classes to represent the contents of an outline view. It is
not a very common way of doing it, at least not in my experience. With
our combined consciousness we should be able to figure this out.
Cheers, Alan
PS. Don't forget to tell us how you fix this. ;)
--
// Quotes from yours truly -------------------------
"You don't forget, you just don't remember."
"Maturity resides in the mind."
"Silence is the Universe's greatest gift."
"When the World realizes that religion really is unimportant, then it
shall evolve."
_______________________________________________
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