Skip navigation.
 
mlRe: advice on filtering TreeNode objects
FROM : Andreas Mayer
DATE : Sun Nov 03 13:33:33 2002

Am Sonntag, 03.11.02 um 09:42 Uhr schrieb Alex Rice:

> I need to apply a filter to the root treenode and have it filter all
> the children on some condition, like hiding todo items that are
> completed, for example. I'm sure I can code it for that particular
> case, but I would rather implement a general-purpose filtering scheme,
> so I can expand it to keyword searching or other filters later on. I
> just can't conceptualize how to do it. Seems like there must be a
> design pattern here. Any suggestions?


IMHO filtering is not a feature of a tree data structure but one of
your particular data stored inside that tree. So I wouldn't build it
into the TreeNode class but in the data source of your outline view.

If filtering is a common task in your app a filter protocol seems the
way to go.


bye.  Andreas.
_______________________________________________
cocoa-dev mailing list | <email_removed>
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.

Related mailsAuthorDate
mladvice on filtering TreeNode objects Alex Rice Nov 3, 09:42
mlRe: advice on filtering TreeNode objects Andreas Mayer Nov 3, 13:33
mlRe: advice on filtering TreeNode objects Alex Rice Nov 3, 22:48
mlRe: advice on filtering TreeNode objects Mike Shields Nov 3, 23:28
mlRe: advice on filtering TreeNode objects Chris Giordano Nov 4, 18:16
mlRe: advice on filtering TreeNode objects Andreas Mayer Nov 5, 05:38
mlRe: advice on filtering TreeNode objects Alex Rice Nov 5, 18:57