title: iPhone SDK: How To Create Sections On UITableView
body: <p>I have this data that I need to put inside my <code>UITableView</code> but I'm getting confused on how to properly implement it. I cannot properly separate the values to segregate the Boys data to the Girls data.</p>
  
  <pre><code>{
  "QUERY": {
      "COLUMNS": [
          "NAME",
          "GENDER"
      ],
      "DATA": [
      [
          "Anne",
          "Girl"
      ],
      [
          "Alex",
          "Boy"
      ],
      [
          "Vince",
          "Boy"
      ],
      [
          "Jack",
          "Boy"
      ],
      [
          "Shiela",
          "Girl"
      ],
      [
          "Stacy",
          "Girl"
      ]
    ]
  },
  "TOTALROWCOUNT": 6
  }
  </code></pre>
  
  <p>I have this codes:</p>
  
  <pre><code>- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView
  {
      return [genderArray count];
  }
  
  - (NSString *)tableView:(UITableView *)tableView titleForHeaderInSection:(NSInteger)section
  {
      return [genderArray objectAtIndex:section];
  }
  
  - (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
  {
      return [namesArray count];
  }
  </code></pre>
  
  <p>namesArray has all the values returned by NAME while genderArray has all the values of GENDER. I'm getting confused.</p>