title: Get an array of properties from an array of custom objects
body: <p>I have an array of custom objects, say <code>Messages</code>.</p>
  
  <p>These messages have an <code>identifier</code>property and I'd like to know what's the most optimal way to get an array of <code>NSString</code> from all those <code>identifiers</code>.</p>
  
  <p>Right now, I'm just looping through all the objects and putting their id in another array, </p>
  
  <pre><code>- (NSArray*)getIdentifiersOf:(NSMutableArray*)array
  NSMutableArray *arrIdentifiers = [[NSMutableArray alloc]init];
  
  for (Message *msg in array){
       [arrIdentifiers addObject:msg.identifier];
  }
  
  return (NSArray*)arrIdentifiers;
  </code></pre>
  
  <p>Obviously this works, but it seems so redundant I thought you might think of something else.</p>
  
  <p>I usually just need to send an array of Id's as parameter for example, and I was thinking something along the lines of</p>
  
  <pre><code>myArray[@"identifier"]
  </code></pre>
  
  <p>that could automatically use the array but only that specific property for every object inside it.</p>