title: Need help adding array to a tableview
body: <p>I'm having trouble adding cells with different content to my app. I know (or think) this needs to be done using an array, but I'm new to xcode and objective-c so I'm not exactly sure how to do this. Any help is much appreciated. Thanks.</p>
  
  <p>Here is a copy of my current code:</p>
  
  <pre><code>#import "RootViewController.h"
  #import "CustomCell.h"
  
  @implementation RootViewController
  
  - (void)viewDidLoad
  {
      [super viewDidLoad];
  }
  
  - (void)viewWillAppear:(BOOL)animated
  {
      [super viewWillAppear:animated];
  }
  
  - (void)viewDidAppear:(BOOL)animated
  {
      [super viewDidAppear:animated];
  }
  
  - (void)viewWillDisappear:(BOOL)animated
  {
      [super viewWillDisappear:animated];
  }
  
  - (void)viewDidDisappear:(BOOL)animated
  {
      [super viewDidDisappear:animated];
  }
  
  /*
   // Override to allow orientations other than the default portrait orientation.
  - (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation {
      // Return YES for supported orientations.
      return (interfaceOrientation == UIInterfaceOrientationPortrait);
  }
   */
  
  // Customize the number of sections in the table view.
  - (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView
  {
      return 1;
  }
  
  - (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
  {
      return 5;
  }
  - (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath {
      return 100;
  }
  // Customize the appearance of table view cells.
  - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
  {
      static NSString *CellIdentifier = @"Cell";
  
      CustomCell *cell = (CustomCell *)[tableView dequeueReusableCellWithIdentifier:CellIdentifier];
      if (cell == nil) {
          cell = [[[CustomCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:CellIdentifier] autorelease];
      }
      cell.imageViews.image = [UIImage imageNamed:@"captainaq_4.jpg"];
      cell.firstLabel.text = @"name ";
      cell.secondLabel.text = @"second name";
      cell.thirdLabel.text = @"third name";
      cell.thirdLabel.textAlignment = UITextAlignmentCenter;
      // Configure the cell.
      return cell;
  }
  
  /*
  // Override to support conditional editing of the table view.
  - (BOOL)tableView:(UITableView *)tableView canEditRowAtIndexPath:(NSIndexPath *)indexPath
  {
      // Return NO if you do not want the specified item to be editable.
      return YES;
  }
  */
  
  /*
  // Override to support editing the table view.
  - (void)tableView:(UITableView *)tableView commitEditingStyle:(UITableViewCellEditingStyle)editingStyle forRowAtIndexPath:(NSIndexPath *)indexPath
  {
      if (editingStyle == UITableViewCellEditingStyleDelete)
      {
          // Delete the row from the data source.
          [tableView deleteRowsAtIndexPaths:[NSArray arrayWithObject:indexPath] withRowAnimation:UITableViewRowAnimationFade];
      }
      else if (editingStyle == UITableViewCellEditingStyleInsert)
      {
          // Create a new instance of the appropriate class, insert it into the array, and add a new row to the table view.
      }   
  }
  */
  
  /*
  // Override to support rearranging the table view.
  - (void)tableView:(UITableView *)tableView moveRowAtIndexPath:(NSIndexPath *)fromIndexPath toIndexPath:(NSIndexPath *)toIndexPath
  {
  }
  */
  
  /*
  // Override to support conditional rearranging of the table view.
  - (BOOL)tableView:(UITableView *)tableView canMoveRowAtIndexPath:(NSIndexPath *)indexPath
  {
      // Return NO if you do not want the item to be re-orderable.
      return YES;
  }
  */
  
  - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
  {
      /*
      &lt;#DetailViewController#&gt; *detailViewController = [[&lt;#DetailViewController#&gt; alloc] initWithNibName:@"&lt;#Nib name#&gt;" bundle:nil];
      // ...
      // Pass the selected object to the new view controller.
      [self.navigationController pushViewController:detailViewController animated:YES];
      [detailViewController release];
      */
  }
  
  - (void)didReceiveMemoryWarning
  {
      // Releases the view if it doesn't have a superview.
      [super didReceiveMemoryWarning];
  
      // Relinquish ownership any cached data, images, etc that aren't in use.
  }
  
  - (void)viewDidUnload
  {
      [super viewDidUnload];
  
      // Relinquish ownership of anything that can be recreated in viewDidLoad or on demand.
      // For example: self.myOutlet = nil;
  }
  
  - (void)dealloc
  {
      [super dealloc];
  }
  
  @end
  </code></pre>