title: How to sort a NSArray which contains NSDictionary?
body: <p>I have a plist like this:</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
  &lt;!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"&gt;
  &lt;plist version="1.0"&gt;
  &lt;dict&gt;
   &lt;key&gt;highscores&lt;/key&gt;
   &lt;array&gt;
    &lt;dict&gt;
     &lt;key&gt;highscoreInSeconds&lt;/key&gt;
     &lt;string&gt;9&lt;/string&gt;
     &lt;key&gt;levelName&lt;/key&gt;
     &lt;string&gt;1&lt;/string&gt;
     &lt;key&gt;name&lt;/key&gt;
     &lt;string&gt;Black&lt;/string&gt;
    &lt;/dict&gt;
    &lt;dict&gt;
     &lt;key&gt;highscoreInSeconds&lt;/key&gt;
     &lt;string&gt;12&lt;/string&gt;
     &lt;key&gt;levelName&lt;/key&gt;
     &lt;string&gt;1&lt;/string&gt;
     &lt;key&gt;name&lt;/key&gt;
     &lt;string&gt;Black&lt;/string&gt;
    &lt;/dict&gt;
   &lt;/array&gt;
  &lt;/dict&gt;
  &lt;/plist&gt;
  </code></pre>
  
  <p>Now I want to sort this by the <code>highscoreInSeconds</code>.</p>
  
  <pre><code>   NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES);
   NSString *plistDirectory = [paths objectAtIndex:0];
   NSString* fullPath = [plistDirectory stringByAppendingPathComponent:@"data.plist"];
  
   NSMutableDictionary* pData = [[NSMutableDictionary alloc] initWithContentsOfFile:fullPath];
   NSMutableArray* highscores = [pData valueForKey:@"highscores"];
  </code></pre>
  
  <p>How can I sort this now?</p>
  
  <p>Thank you very much!
  :)</p>
  
  <p>Have a nice day.</p>
  
  <p>PS: It should look like this at the end:</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
  &lt;!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"&gt;
  &lt;plist version="1.0"&gt;
  &lt;dict&gt;
   &lt;key&gt;highscores&lt;/key&gt;
   &lt;array&gt;
    &lt;dict&gt;
     &lt;key&gt;highscoreInSeconds&lt;/key&gt;
     &lt;string&gt;12&lt;/string&gt;
     &lt;key&gt;levelName&lt;/key&gt;
     &lt;string&gt;1&lt;/string&gt;
     &lt;key&gt;name&lt;/key&gt;
     &lt;string&gt;Black&lt;/string&gt;
    &lt;/dict&gt;
    &lt;dict&gt;
     &lt;key&gt;highscoreInSeconds&lt;/key&gt;
     &lt;string&gt;9&lt;/string&gt;
     &lt;key&gt;levelName&lt;/key&gt;
     &lt;string&gt;1&lt;/string&gt;
     &lt;key&gt;name&lt;/key&gt;
     &lt;string&gt;Black&lt;/string&gt;
    &lt;/dict&gt;
   &lt;/array&gt;
  &lt;/dict&gt;
  &lt;/plist&gt;
  </code></pre>
  
  <p>You don't need to say me how to write a plist i knew that.</p>