title: How to sort NSMutableArray using sortedArrayUsingDescriptors?
body: <p>I have a question about sorting <code>NSMutableArray</code>. I can use <code>sortedArrayUsingDescriptors:</code> method to sort an array with objects. </p>
  
  <p>For example  I have  an <code>NSMutableArray</code> of <code>places</code> where I have an attribute <code>frequency</code> (int value) and I want to sort descending on <code>frequency</code> but I don't know how to use it correctly.</p>
  
  <p><strong>What do I put as a key in <code>initWithKey</code>?</strong></p>
  
  <p>My object <code>place</code> contains:</p>
  
  <pre><code>NSString * name;
  NSString * address;
  NSString * frequency;
  NSString * type;
  </code></pre>
  
  <hr>
  
  <pre><code>NSMutableArray * places;
  
  ... populate array with objects ...
  
  NSSortDescriptor * sortByFrequency =
     [[[NSSortDescriptor alloc] initWithKey:@"????????" ascending:NO] autorelease];
  
  NSArray * descriptors = [NSArray arrayWithObject:sortByFrequency];
  NSArray * sorted = [x sortedArrayUsingDescriptors:descriptors];
  </code></pre>