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 10:35:57 -0700 (PDT)
Many thanks for the reply.
> you'll want to look
> more closely at the documentation. There is indeed
> an -
> arrangedObjects method for NSTreeController. It
> returns an array just
> like an NSArrayController.
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.)
> Also, though probably not the best solution, you
> can always bind
> the NSTreeController's contentArray to another
> controller ...
Thanks for the suggestion - could you please
elaborate? The content array is already set to an
NSMutableArray in MyDocument. But like I say, my main
problem is that I want to use the same array of node
objects in different ways in two different outline
views. The node object can have an isFolder ivar set
to YES or NO. If it is NO, it should not be allowed to
have children and should not be visible in the
folders-only outline view, only in the associated
table view. But ALL nodes, folder or not, should be
visible in another outline view... This is why a
filter for the folders-only outline view seemed
simplest, but maybe there is another way?
Many thanks again for taking the time to reply - any
other suggestions would be greatly appreciated,
Keith
--- SA Dev <email@hidden> wrote:
> Keith:
>
> First, the pun is good, really. ;-) Second,
> you'll want to look
> more closely at the documentation. There is indeed
> an -
> arrangedObjects method for NSTreeController. It
> returns an array just
> like an NSArrayController.
>
> Also, though probably not the best solution, you
> can always bind
> the NSTreeController's contentArray to another
> controller ...
>
>
>
> On Jun 21, 2005, at 12:34 PM, Keith Blount wrote:
>
> > Hello,
> >
> > I am beginning to think that NSTreeController is
> only
> > half-finished, but in a last, desperate attempt to
> > find anyone who might know how to resolve some of
> its
> > major issues, I hope no one minds me asking my
> > questions again here. (First, let me apologise
> posting
> > a message three times yesterday - this wasn't an
> > intentional spam, just a [human] problem with my
> > e-mail.)
> >
> > 1) Is there ANY way to filter an NSTreeController?
> > Mmalc's Filtering Controller example shows how to
> do
> > it for NSArrayController by overriding
> > -arrangeObjects:, but there is no equivalent
> method in
> > NSTreeController.
> >
> > 2) Failing that, which would be the ideal solution
> to
> > my problem (I think), this is what I want to do -
> I
> > would be grateful to anybody who could tell me
> where
> > to start: I have an NSTreeController that is
> supposed
> > to show folders in an NSOutlineView, and an
> > NSArrayController that is supposed to show the
> > contents of these folders in an NSTableView, much
> like
> > in Mail. The trouble is that in a separate view, I
> > want to set up an NSTreeController that will show
> both
> > folders AND contents in a single NSOutlineView.
> What
> > is the best way to set this up? Without filtering,
> it
> > seems impossible...
> >
> > 3) I have asked this a few times, so I am pretty
> sure
> > that no one knows the answer - in fact, I'm pretty
> > sure that NSTreeController screws this up so badly
> > that it's impossible - but... Is there *any* way
> to
> > get NSOutlineView's
> > -outlineView:persistentObjectForItem: and
> > -outlineView:itemForPersistentObject: datasource
> > methods when using an NSTreeController? Yes, I
> know
> > about the -observedObject private method which can
> get
> > the item for the former method, but there seems no
> way
> > to convert this back to an
> _NSArrayControllerTreeNode
> > object, which would be required to get these
> > datasource methods working. It seems silly that
> > NSTreeController renders these fundamental methods
> > useless.
> >
> > All these problems suggest to me that I may have
> to
> > ditch bindings for my project altogether, but if
> > anyone has any suggestions, I would be
> ***really***
> > grateful.
> >
> > Many thanks in advance,
> > Keith
> >
> > P.S. Apologies for the awful pun in the title
> >
> >
> >
> >
> ____________________________________________________
> > Yahoo! Sports
> > Rekindle the Rivalries. Sign up for Fantasy
> Football
> > http://football.fantasysports.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:
> >
>
>
> > 40silentalcove.net
> >
> > This email sent to email@hidden
> >
>
>
____________________________________________________
Yahoo! Sports
Rekindle the Rivalries. Sign up for Fantasy Football
http://football.fantasysports.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