If looking up character objects by ID is a common operation, you should create a mapping from id's to character objects, at which point doing the lookup from your second array will be trivial:
NSMutableDictionary* charactersById = [NSMutableDictionary dictionary];
for (Character* character in characters) {
[charactersById setObject:character forKey:[character IDE]];
}
(Note that I've made your class upper-case for the example code; you should do the same in your code since writing code that ignores standard language conventions is a bad idea in any language; it significantly reduces the readability of your code.)
smorgan
2009-07-20 03:09:24