title: Continuously populating a tableview
body: <p>I have a UITableView that I want updated by a method called by a timer. What I have now is:</p>
  
  <pre><code>-(void) populateTable {
  NSLog(@"done");
  NSArray *array = [[NSArray alloc] initWithObjects:@"ob 1",@"ob 2",@"ob 3",nil];
  self.listData = array;
  [array release];
  }
  
  
  - (void)viewDidLoad {
  [NSTimer scheduledTimerWithTimeInterval:2.0 target:self selector:@selector(populateTable) userInfo:nil repeats:YES];
  [super viewDidLoad];
  }
  
  #pragma mark -
  #pragma mark Table View Data Source Methods
  
  - (NSInteger)tableView:(UITableView *)tableView
  numberOfRowsInSection:(NSInteger)section
  {
  return [self.listData count];
  }
  
  - (UITableViewCell *)tableView:(UITableView *)tableView
       cellForRowAtIndexPath:(NSIndexPath *)indexPath
  {
  
  static NSString *SimpleTableIdentifier = @"SimpleTableIdentifier";
  UITableViewCell *cell = [tableView
                           dequeueReusableCellWithIdentifier:SimpleTableIdentifier];
  if (cell == nil) {
      cell = [[[UITableViewCell alloc]initWithStyle:UITableViewCellStyleDefault
                                    reuseIdentifier:SimpleTableIdentifier] autorelease];
  }
  
  NSUInteger row = [indexPath row];
  cell.textLabel.text = [listData objectAtIndex:row];
  return cell;
  
   }
  </code></pre>
  
  <p>If i put the array and <code>self.listData = array</code> into <code>viewDidLoad</code> it works, but won't repeat. My method <code>populateTable</code> is being called, but doesn't actually put anything in the table. This is my first time using a UITableView so I don't know too much how they work. I did this much by following a tutorial. How can use a method to populate the data?</p>