title: Phonegap contact sort order on ios
body: <p>Does anyone know how to sort the contact data that phonegap liberates from iOS to javascript. The order at the moment is nothing to do with alphabetical sorting. I want to sort on last name.</p>
  
  <p>Here is my contact code:</p>
  
  <pre><code>function init_contacts() {
       var fields = [ "name","phoneNumbers"];
       navigator.service.contacts.find(fields, contactSuccess, contactError, '');
  }
  function contactSuccess(contacts) {
      for (n = 0; n &lt; contacts.length; n++) {
          if (contacts[n].phoneNumbers) {
              for (m = 0; m &lt; contacts[n].phoneNumbers.length; m++) {
                  addToMyContacts(contacts[n].name.formatted, contacts[n].phoneNumbers[m].value);
                  console.log('Found ' + contacts[n].name.formatted + ' ' + contacts[n].phoneNumbers[m].value);
              }
          }
  }
  $("#my_contacts").listview("refresh"); 
  };
  
  function contactError() {
      navigator.notification.alerter('contactError!');
  };
  </code></pre>