Re: Best way to selectively show objects in a tree controller/outlineview
Re: Best way to selectively show objects in a tree controller/outlineview
- Subject: Re: Best way to selectively show objects in a tree controller/outlineview
- From: Tony Romano <email@hidden>
- Date: Wed, 31 Mar 2010 11:39:30 -0700
Thanks Joanna, my data is not Core Data and I haven't had the opportunity to use it much. I did some research and it is definitely on my list of things to learn. Not sure why NSTreeController does not support predicate filters...
Funny, Finder has a hidden preference to show or hide hidden files. In order for it to take effect, you need to restart your finder window and you can hear it access the disk to repopulate the tree.
Looks like the only practical solution is to filter and the query from the tree controller(arrangeObjects and enumerateChildren method I implement as part of my node object for the sub-nodes).
Thanks to all!
-tony
On Mar 31, 2010, at 1:19 AM, Joanna Carter wrote:
> Hi Tony
>
>> Based on a user preference, I want to be able to selectively show/not show items contained in the tree controller by an outline view. For example, suppose the tree controller has these items: A,B,C,D,D,E,F,G,H. The outline view will normally display all of the items. Now suppose the user sets a preferences that he/she doesn't want to show item(s) 'D'. The outline view should now display: A,B,C,E,F,G,H.
>>
>> One obvious method(albeit brute force) is to rebuild the tree controller list and redisplay it. For what I want to do, this is way too expensive of an operation. In addition, the user can toggle back and forth the preference. There doesn't seem to be an obvious way to tell the outline controller, "skip or hide this item".
>
> One obvious way is, not to work with the tree controller but, to work with the tree itself. If the data is retrieved from a Core Data store, you can mark each item with a "Valid" property and use a predicate on the fetch.
>
> Joanna
>
> --
> Joanna Carter
> Carter Consulting
>
>
-tony
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden