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.
精彩评论