The problem here is you are using the dynamic value assigned to the predicate directly with NSSString stringWithFormat and using %@ as the substitution for the dynamic replacement. For the key portion if you make it %K, this will work fine. So, you predicate would be,
NSPredicate *predicate = [NSPredicate predicateWithFormat: @"%K IN (%@)", uniquePropertyKey, valuesWithDupes];