I'm using an NSTreeController bound to an NSBrowser to display a hierarchical data structure in my app. I now find I need to implement filtering, i.e. hiding items at all levels of the hierarchy that don't match some condition. Unfortunately it appears that only NSArrayController supports a - filterPredicate; there's no equivalent in NSTreeController. :-(

At this point it seems like my options are either
(1) Add the filtering to my data model, i.e. have my content classes' - children methods filter their results … I don't want to do this because it prevents the same data model from appearing in two views with different filters.
or
(2) Create a parallel hierarchy of filtered objects and give that to the tree controller … I don't want to do this because it having the proxy objects mimic the original ones to KVC / KVO will be a pain, but otherwise I have to change around all of the bindings in my nib.

Is there some other alternative? I know NSTreeController already builds its own shadow hierarchy of NSTreeNodes … is there a way I can subclass NSTreeController or NSTreeNode to splice in the filtering?

—Jens

Attachment: smime.p7s
Description: S/MIME cryptographic signature

_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to [EMAIL PROTECTED]

Reply via email to