Function fails at initwithobjects during assert on count check.
j++ within if check should not be there?
(M13OrderedDictionary )filteredOrderDictionarysUsingPredicateForObjects:(NSPredicate )predicate
{
NSArray tempObj = [objects filteredArrayUsingPredicate:predicate];
int i = 0;
int j = 0;
NSMutableArray tempKey = [[NSMutableArray alloc] init];
//Iterate though, since all objects are returned in order, you can just look along, object by object, untill they are equal, and grab the coresponding key.
while (i < tempObj.count && j < keys.count) {
if ([[tempObj objectAtIndex:i] isEqual:[objects objectAtIndex:j]]) {
[tempKey addObject:[keys objectAtIndex:j]];
// j++;
i++;
}
j++;
}
return [[M13OrderedDictionary alloc] initWithObjects:tempObj pairedWithKeys:tempKey];
}
Function fails at initwithobjects during assert on count check. j++ within if check should not be there?