In my app I have a class Person with personId property.
Now I need some data structure to hold a bunch of unique Person objects (u
I think what you want is an NSMutableDictionary, mapping the personId to the Person object.
NSMutableDictionary *dict = [[NSMutableDictionary alloc] init];
Person *person = something;
[dict setObject:personObj forKey:[NSNumber numberWithInt:[person personId]]];
... etc ...
(don't forget to release dict later somewhere).
In order to find the Person class for the specified personId (12, say), you can simply do:
Person *person = [dict objectForKey:[NSNumber numberWithInt:12]];
Note: that you have to store both the key and the value as objects (you cannot store primitive types).