How to set up single array or dictionary for use in multiple datasources?

How to set up single array or dictionary for use in multiple datasources?

I have multiple TableViewDatasources that need to display list of objects form same pool depending of certain property. E.g.

object.flag1 is set- it will show up in TableView1 object.flag2 is set- it will show up in TableView2 

The obvious way would be to have separate arrays for each TableView, But same object may appear in different arrays. Also I need to update objects very often or access all objects through same array.

How do I setup a single dictionary or array to have all objects in one structure?

To put it in another way: When table view or selection changes, application need to redraw TableViews with the new data. Application have to access the pool of objects and search through them using iterator and accessing each object and its properties.

I think that this is an expensive operation and want to avoid that. Perhaps maybe by making a global pool of objects a dictionary and exposing objects properties as dictionary fields.

So instead of iterating global pool of objects I could access global pool Dicitonary in a manner of database by selecting objects that has fields that match particular criteria.

Anyone know any example of doing that?

Can I develop an iPhone app using java?


Lock orientation UIWebView on iPhone
This sounds like a case of premature optimization.

How to ALTER sqlite column (iPhone)?
Unless you are managing many hundreds of items and/or causing redraws to happen terribly often, iterating through even a hundred objects and maintaining a couple of arrays isn't going to incur enough overhead -- either memory or CPU -- to be problematic..
How to escape characters in href=mailto (iPhone)
Implement it the easy way, then measure it to determine if you really have a performance problem..
iPhone SDK: UIWebView

Focus OnLoad=“document.form_id.form_field_id.focus();” on the iPhone

Getting access to touchesBegan/Moved/Ended to a UITableViewCell


Function Variable passed to setTimeout not working?
I'd be inclined to create proxy collections which act as the data sources.

These proxies gather the appropriate objects from the pool when they prepare their content.

Without knowing the scale of your pool and subsets, it's too early to consider optimising that..

92 out of 100 based on 82 user ratings 1382 reviews