I have many NSDictioanries in NSArray. Since there are about 1300 of them, and I need to search for them according to the following criteria:
1. Name
2. DOB
3. Type
4. Grade
5. Condition
6. PUP
7. Unit Number
Here is an example of such a dictionary:
<Unit>
<UnitNumber>20110501100507134</UnitNumber>
<Name>01'' 2ply Mat</Name>
<DOB>3/24/2011 12:00:00 AM</DOB>
<Type>2ply Mat</Type>
<Grade>Cull</Grade>
<Condition />
<Depth>01</Depth>
<Width>01</Width>
<Length>01</Length>
<PUP>Cable</PUP>
<Finishing />
</Unit>
Right now I’m thinking about iterating over an array, looking for the first criterion, then again looping through the filtered array and looking for the second criterion, and so on .... But this is 7 for loops of at least 1300 dictionaries.
What are my alternatives? Thank.
UPDATE: Okay, so for each of the criteria listed above, I will have a text box and the user will specify the criteria there, and then click the search button ... (if that becomes more clear)
Also, it is for iPhone / iPad
source
share