Just iterate over instances of the class and create a new array:
NSMutableArray * aProperties = [[[NSMutableArray alloc]
initWithCapacity:[classInstances count]]
autorelease];
for(MyClass * myInstance in classInstances) {
[aProperties addObject:[myInstance a]];
}
If your class matches the keyword encoding for a, you can also specify an array for the values directly:
NSArray * aProperties = [classInstances valueForKey:@"a"];
source
share