title: Getting an NSArray of a single attribute from an NSArray
body: <p>I am facing a very regular scenario.</p>
  
  <p>I have an NSArray which has object of a custom type, say Person. The Person class has the attributes: firstName, lastName and age.</p>
  
  <p>How can I get an NSArray containing only one attribute from the NSArray having Person objects?</p>
  
  <p>Something like:</p>
  
  <pre><code>NSArray *people;
  NSArray *firstNames = [people getArrayOfAttribute:@"firstName" andType:Person.Class]
  </code></pre>
  
  <p>I have a solution of writing a for loop and fill in the firstNames array but I don't want to do that.</p>