I think you have to do that "manually" by enumerating over all objects,
and using a set to keep track of which keys have already been added.
Something like this (untested):
NSMutableSet *b1ums = [NSMutableSet set];
NSMutableArray *uniqueObjects = [NSMutableArray array];
for (MyClass *obj in objects) {
if (![b1ums containsObject:obj.b1_um]) {
[b1ums addObject:obj.b1_um]; // remember key
[uniqueObjects addObject:obj]; // add object
}
}
Theoretically, you could override isEqual and hash in your custom class
to consider two objects identical if the b1_um property is equal.
But that might be a bit overkill.
Edit: I had not noticed that your question is tagged with [core-data].
For managed objects, an alternative approach would be possible: Execute a fetch request
with NSDictionaryResultType and set propertiesToGroupBy to the "b1_um" attribute.
Then you can pick one object from each group in the returned result.
NSSet.