If a dictionary of arrays would work...
NSMutableDictionary *groupedDictionary = [NSMutableDictionary dictionary];
for (Object *anObject in originalArray) {
NSMutableArray *groupArray = [groupedDictionary objectForKey:anObject.group];
if(groupArray) {
[groupArray addObject:anObject];
} else {
groupArray = [NSMutableArray arrayWithObject:anObject];
[groupedDictionary addObject:groupArray forKey:anObject.group];
}
}
The result is a dictionary of arrays. The key is the group, the value is the array of objects in that group.
If you still need it as an array, you can actually then turn this dictionary into an array by doing this:
NSArray *groupedArrays = [groupedDictionary allValues];