title: Multiple sections array in tableview
body: <p>First off i would like to say i had a similar post like this but some how it just disappeared so if it reappears it was not intention to double post.</p>
  
  <p>I created a uitableview with 3 sections and is being populated from 3 different arrays</p>
  
  <pre><code>- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
  </code></pre>
  
  <p>{
  //Removed the bunch of code here to make it shorter</p>
  
  <pre><code>switch (indexPath.section) {
      case 0:
          cell.textLabel.text=[DogArray objectAtIndex:indexPath.row];
          break;
       case 1:
          cell.textLabel.text=[BirdArray objectAtIndex:indexPath.row];
          break;
      case 2:
          cell.textLabel.text=[FishArray objectAtIndex:indexPath.row];
         break;
      default:
          break;
  }
  
  
  
  
  [cell setAccessoryType:UITableViewCellAccessoryDisclosureIndicator];
  return cell;
  </code></pre>
  
  <p>}</p>
  
  <p>Each of the three sections get their own values from their respective array.</p>
  
  <p>The only problem is that. before i used one array so i would assign like this</p>
  
  <pre><code> (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
  {
  
  
  if (checInt==0) 
  { 
      ThridView *summary=[[ThridView alloc]init];
      summary.detailViewController = detailViewController;
      self.detailViewController.receivedRainObject = [MainArray objectAtIndex:indexPath.row];//Pay attention to this line
  </code></pre>
  
  <p>This would pass in Pit bull,dove or swordfish to Summary base on who every was the .row....unfortunatly i cannot do this anymore since i use three different arrays. I was thinking of using a switch but even when i select swordfish from the fish array.
  NSLOG([DogArray objectAtIndex:indexPath.row]) shows me pitbull
  and
  NSLOG([BirdArray objectAtIndex:indexPath.row]) shows me dove
  so i cant say when those two are null .</p>
  
  <p>Would love too know a way i could still pass in what every animal i select even if they come from different arrays, thanks</p>