iPhone SDK Nested For Loop performance
- by Skeep
Hi All,
I have a NSArray of string id and a NSDictionary of NSDictionary objects. I am currently looping through the string id array to match the id value in the NSDictionary.
There are around 200 NSDictionary objects and only 5 or so string ID.
My current code is such:
for (NSString *Str in aArr) {
for (NSDictionary *a in apArr)
{
if ([a objectForKey:@"id"] == Str)
{
NSLog(@"Found!");
}
}
}
The performance of the above code is really slow and I was wondering if there is a better way to do this?