title: How to change the content of the UITableView with a button click?
body: <p>I have a UItableview with array of contents in it.There are two array ,I want to switch the array by using a button click.
  My code is</p>
  
  <pre><code>- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
  
  tab.backgroundColor = [UIColor clearColor];
  tab.separatorColor = [UIColor clearColor];
  cell.chapterAndVerse.text = [NSString stringWithFormat:@"%d",indexPath.row+1];
  cell.chapterAndVerse.font = [UIFont fontWithName:@"Georgia" size:17.0];
  cell.chapterAndVerse.frame=CGRectMake(0, 10, 30.0, 20.0);
  cell.textLabel.text =  [NSString stringWithFormat:@"  %@",[delegate.allSelectedVerseMalayalam objectAtIndex:indexPath.row]];
  
  cell.textLabel.font = [UIFont fontWithName:@"testfont" size:18];
  cell.backgroundColor = [UIColor clearColor];
  }
  </code></pre>
  
  <p>my array is delegate.allSelectedVerseMalayalam ,I want this array to be changed with delegate.allSelectedVerseEnglish in button click.When the button for english is clicked by the user it changes the tableviewcontent(my table names is tab)to delegate.allSelectedVerseEnglish .How is this possible.Plese help me to figure out from this problem.
  Thanks in advance.
  EDIT:</p>
  
  <pre><code> - (void)viewDidLoad {
  NSLog(@"%@", delegate.allSelectedVerseMalayalam);
      tempArray = [[NSMutableArray alloc] init];
      [tempArray addObjectsFromArray:delegate.allSelectedVerseMalayalam];
      NSLog(@"%@", tempArray);
  
      [self.tab reloadData];
  }
  -(IBAction)_clickbtndefaultlnguageset:(id)sender
  {
      [tempArray removeAllObjects];
      [tempArray addObjectsFromArray:delegate.allSelectedVerseHindi];
      [self.tab reloadData];
  
  }
  </code></pre>
  
  <p>in tableview</p>
  
  <pre><code>cell.chapterAndVerse.text = [NSString stringWithFormat:@"%d",indexPath.row+1];
  cell.chapterAndVerse.font = [UIFont fontWithName:@"Georgia" size:17.0];
  cell.chapterAndVerse.frame=CGRectMake(0, 10, 30.0, 20.0);
  cell.textLabel.text =  [NSString stringWithFormat:@"  %@",[tempArray objectAtIndex:indexPath.row]];
  
  // cell.textLabel.textColor = [UIColor darkGrayColor];
  cell.textLabel.font = [UIFont fontWithName:@"testfont" size:18];
  cell.backgroundColor = [UIColor clearColor];
  </code></pre>