title: How to build an Array or Nested Array to display in UITableView and then sort by certain objectAtIndex?
body: <p>Sorry for such a confusing title but it's hard to explain in a few words what I'm trying to accomplish. I'll try to explain the best I can. Ok, I'm parsing data from a xml file. It's constructed like so:</p>
  
  <pre><code>&lt;item1&gt;
     &lt;subitem1&gt;text&lt;/subitem1&gt;
     &lt;subitem2&gt;text&lt;/subitem2&gt;
     &lt;subitem3&gt;text&lt;/subitem3&gt;
     &lt;subitem4&gt;text&lt;/subitem4&gt;
     &lt;subitem5&gt;text&lt;/subitem5&gt;
  &lt;/item1&gt;
  &lt;item2&gt;
     &lt;subitem1&gt;text&lt;/subitem1&gt;
     &lt;subitem2&gt;text&lt;/subitem2&gt;
     &lt;subitem3&gt;text&lt;/subitem3&gt;
     &lt;subitem4&gt;text&lt;/subitem4&gt;
     &lt;subitem5&gt;text&lt;/subitem5&gt;
  &lt;/item2&gt;
  &lt;item3&gt;
     &lt;subitem1&gt;text&lt;/subitem1&gt;
     &lt;subitem2&gt;text&lt;/subitem2&gt;
     &lt;subitem3&gt;text&lt;/subitem3&gt;
     &lt;subitem4&gt;text&lt;/subitem4&gt;
     &lt;subitem5&gt;text&lt;/subitem5&gt;
  &lt;/item3&gt;
  so on and so on...
  </code></pre>
  
  <p>So basically I want to display each item into a separate row in a UITableView and put each subitem into it's parent's row/cell as a label to display the info about it's parent "item".
  Also, I need to be able to sort each item by one of it's subitems i.e. let's say subitem4. If subitem4 is equal to some string then it would display that item into the UITableView however if subitem4 isn't equal to that string I compare it to then that item wouldn't get displayed in the UITableView. As of right now I really don't have any working code because I'm not sure how to go about making this work. I don't know how I would do this because I have 1 array right now with all of the subitems together and I'm just separating each subitem and putting them into separate arrays so I can distinguish between each item row, I'm do it with the following code:</p>
  
  <pre><code>int totalNames = [Names count];
  id name = [Names objectAtIndex:1];
  [listOfItems addObject:name];
  </code></pre>
  
  <p>I'm pretty sure I'm going about this the wrong way. There must be a better way to do this logically. Any help or advice would be much appreciated. I'm mentally exhausted with this. Thanks.</p>