I have and array of custom objects of Person Class
Person : NSObject{
NSString *firstName;
NSString *lastName;
NSString *age;
}
NSMutableArray
There isn't a built in group by method in NSArray
. Your example implementation could be added as a category.
Unfortunately, the @distinctUnionOfObjects
operation will only return the strings of the firstName property: John, David. It won't do a group by
operation, nor is there such an operation.
Collection Operations