Re: Design pattern for collection of items and many subsets
Re: Design pattern for collection of items and many subsets
- Subject: Re: Design pattern for collection of items and many subsets
- From: Trygve Inda <email@hidden>
- Date: Fri, 30 Apr 2010 21:29:33 +0000
- Thread-topic: Design pattern for collection of items and many subsets
Let me re-phrase this to make it more clear.
I have something like Mail. It receives "messages" and these get
stored in a "master box".
I have dumbBoxes which are lists that the user can drag messages to. I also
have smartBoxes that filter based on criteria.
Right now, when the user clicks on a box (which are listed in a SourceView,
I filter the array (smartBox) or load an array (dumbBox) as needed and
display the items in a Table.
This methodology prevents me from dynamically showing the message count in
each box esp as new messages come in. When a new message comes in, I'd like
it to show up in the master box but also be reflected in the count of the
smartBoxes that it meets the criteria for.
What is the best way to arrange my arrays and Array Controllers for all this
to happen on the fly without having to refilter all the previous messages?
Eg it does not seem efficient to call
[myArray filteredArrayUsingPredicate:predicate]
(or similar) on each smartBox after each new message come in... As I may
receive 100 messages in a fairly short time span.
I also really only want one copy of the data so if a user edits the message
properties at all, it is reflected in all places where that message appears.
Do I need a separate ArrayController for each box? If so where does it's
contentArray come from?
Keep in mind that after displaying the contents of a smartBox in a table
(which might have 50 messages), there is a text field which needs to filter
down this set of 50. So I have:
MasterArray (500) (filter)-> smartBox (50) (filter)-> filtertext (10)
Thanks,
Trygve
_______________________________________________
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