I have 4 NSArray in which each object is dictionary. Something like this:
**Array1 - 30 objects(dictionaries):**
[0]
<Key>Name</key> - <Value>Paul</value>
<Key>City</key> - <Value>New York</value>
<key>Birthday</key> - <value>5.4.1954</value>
[1]
<Key>Name</key> - <Value>John</value>
<Key>City</key> - <Value>New York</value>
<key>Birthday</key> - <value>1.17.1936</value>
etc.
**Array2 - 40 objects(dictionaries):**
[0]
<Key>Name</key> - <Value>Queen</value>
<key>Birthday</key> - <value>5.4.1970</value>
[1]
<Key>Name</key> - <Value>TennesseeKids</value>
<key>Birthday</key> - <value>1.17.1995</value>
etc.
All arrays have the key "birthday".
I Want: combine all the array in one big NSMutableArray/NSMutableDictionary and retrieve first 10 records ordered by date.
I don't ask you how to order my record by date or something, I just want to know what is the best way to implement my idea.
I tried to add all arrays in NSMutableDictionary:
[_mainDictionary setObject:array1 for key:@"firstarray"];
[_mainDictionary setObject:array2 for key:@"secondarray"];
[_mainDictionary setObject:array3 for key:@"thirdarray"];
[_mainDictionary setObject:array4 for key:@"fourarray"];
But I don't think that this is the best way to do it.
Hope for your help. Cheers.