Re: NSTreeController - please help, can't see the forest for the tree controller
Re: NSTreeController - please help, can't see the forest for the tree controller
- Subject: Re: NSTreeController - please help, can't see the forest for the tree controller
- From: Keith Blount <email@hidden>
- Date: Tue, 21 Jun 2005 11:07:34 -0700 (PDT)
Many thanks again for the reply. Basically, what I
want to accomplish is this: My app is a project
manager for text documents. These are to be stored as
RTFD files inside a file wrapper. The user can
organise them any way he or she likes within the app,
by creating virtual folders in which to put text
documents - just as in Xcode the outline view shows
folders that don't exist on disk to help manage and
organise .h and .m files that do. More like Mail, I
had hoped to have an outline view showing only folders
on the left, with a table view on the right showing
all contents of the selected folder in the outline
view, folder or document. I also want to have, for a
separate view, a different outline view that shows
both folders and documents. This is my main problem,
along with saving the state of the outline view which
seems more difficult using NSTreeController because
the datasource methods are rendered unusable (I think)
by the proxy objects.
So... Currently my node model object - which I've been
using for test purposes - just contains an
NSMutableDictionary of properties such as title,
description, etc, which is bound to the the
outline/table view columns, and an NSMutableArray of
contents, which is bound to the NSTreeController's
children key path.
I feel that I should also be using the leaf key path
so that in the case of the outline view that shows
everything, I can tell it which items cannot have
children - but I have no idea how to use the leaf key
path as it is not described in the docs ("Sets the
leaf key path" is about as far as they go - hmm,
useful).
Thanks again,
Keith
--- SA Dev <email@hidden> wrote:
>
> On Jun 21, 2005, at 1:35 PM, Keith Blount wrote:
>
> > I have been through the documentation (what there
> is
> > of it - I've filed an enhancement request) and
> know
> > that there is an arrangedObjects method, but I was
> > talking about the -arrangeObjects: method - this
> > method is present in NSArrayController but not in
> > NSTreeController, and it is this method that
> mmalc's
> > filtering controller overrrides. I did try
> overriding
> > -arrangedObjects instead, but it turns out that
> > NSTreeController's -arrangedObjects method doesn't
> > return an NSArray directly, but an object of
> private
> > class _NSControllerTreeProxy, so it's impossible
> (?)
> > to alter. (This seems to be the trouble all the
> way
> > through with NSTreeController - any time you want
> to
> > access anything, you run into proxy objects of
> > undocumented private classes in a manner
> unprecedented
> > anywhere else.)
> >
>
> My apologies. Reading your original post more
> closely, I see that
> I'm probably not answering the question you're
> asking. I might be
> missing something simple, but could you please
> provide more specific
> details about what you're trying to accomplish? More
> to the point,
> could you describe your model in a bit more detail?
>
> As to the proxy objects, it's my understanding
> that
> NSObjectController, NSArrayController, and
> NSTreeController all
> return proxy objects. Use key-value coding to access
> their properties.
>
>
>
__________________________________________________
Do You Yahoo!?
Tired of spam? Yahoo! Mail has the best spam protection around
http://mail.yahoo.com
_______________________________________________
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