Re: advice on filtering TreeNode objects
Re: advice on filtering TreeNode objects
- Subject: Re: advice on filtering TreeNode objects
- From: Andreas Mayer <email@hidden>
- Date: Sun, 3 Nov 2002 13:33:33 +0100
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@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.