title: Turning an NSArray of custom objects into a alphabetically sectioned UITableView with an index?
body: <p>(hmm.. long title)</p>
  
  <p>If I start out with an NSArray of custom objects (each object is a Person) like this:</p>
  
  <pre><code>{
    surname:Allen   forename: Woody,
    surname:Baxter  forename: Stanley,
    surname:Clay    forename: Cassius
  }
  </code></pre>
  
  <p>..etc..</p>
  
  <p>You can see that the array is already in surname order. How do I use that array to create a a UITableView with a section headers A, B C etc, as well as an index thing on the side running vertically</p>
  
  <pre><code>                                                               A
                                                                 B
                                                                 C
  </code></pre>
  
  <p><strong>EDIT</strong></p>
  
  <p>I guess what I'm asking is how to turn my array of objects into a Section Array, with all the first letters of the Surnames, and a Surname Array which is perhaps a nested array like this:</p>
  
  <pre><code>{ 
    letter: a
    {  surname:Allen   forename: Woody   }
    letter: b
    {  surname:Baxter  forename: Stanley }
    etc
  } 
  </code></pre>
  
  <p>In fact, perhaps just a nested array will do.</p>