I have an array of arrays with objects and now want to get all objects for a certain date (which is an object property).
what's the best way to query it?
I have an array of arrays with objects and now want to get all objects for a certain date (which is an object property).
what's the best way to query it?
In this case you have to make a double for-loop with fast enumeration and look into each object.
for(NSArray* anArray in yourArray) {
for(id aObject in anArray) {
//compare date
}
}
Maybe it would be better if you exchange the first array with a dictionary which keys are dates. For each key in the dictionary you store an array with objects whose date is the same as in the dictionary key. With that you won't have to look at each single object.