I have the following code that populates an array (this is within a loop):
NSString *code = [NSString stringWithFormat:@"%@ - (%@) %@",[tempDic objectForKey:@"state"],[tempDic objectForKey:@"city"],[tempDic objectForKey:@"name"]];
[tempArrayOfAirports removeObjectIdenticalTo:code]; // checks for a previous object, then removes if found
[tempArrayOfAirports addObject:code]; //adds the object
Previously, code had simply been:
NSString *code = [tempDic objectForKey:@"city"];
[tempArrayOfAirports removeObjectIdenticalTo:code];
[tempArrayOfAirports addObject:code];
Which worked fine, but for some reason, changing "code" is keeping it from finding other identical strings. My result is a huge array with many, many repeated objects.