I have an NSArray containing objects with a size property.
NSArray
size
How can I check if the NSArray has two objects with the same value
Try this code:
NSSet *myset = [NSSet setWithArray:[myarray valueForKey:@"size"]]; int duplicatesCount = [myarray count] - [myset count];
size here is the object property.