title: UITextViews in a UITableView link detection bug in iOS 7
body: <p>I have custom UITableViewCells that contain a UITextView. I have link detection in the UITextView turned on in Interface Builder. When I first load the table view, everything seems to be working, but as I scroll up and down the table view, the link detection gets messed up. Specifically, cells that just have regular text (which are presented normally initially) are being shown as links (all the text in the text view is coloured blue and is an active link), and the links point to objects that are in some of the other table view cells. For example a link might point to a website that was in a different table view cell, or launch an email to an address that was in a different table view cell.</p>
  
  <p>It seems like when the table view cells are being reused, even though the text view text is being updated, the links are somehow getting saved.</p>
  
  <p>This only happens in iOS 7, not iOS 6. It happens in the simulator and on my device.</p>
  
  <p>Here is the code:</p>
  
  <pre><code>- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
  {
      NSString *sectionKey = [self.orderedSectionKeys objectAtIndex:indexPath.section];
      NSDictionary *infoDictionary = [[self.tableViewData objectForKey:sectionKey] objectAtIndex:indexPath.row];
  
      static NSString *cellIdentifier = @"InfoDefaultTableViewCell";
      InfoDefaultTableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:cellIdentifier];
      if (cell == nil) {        
          NSArray *topLevelObjects = [[NSBundle mainBundle] loadNibNamed:@"InfoTableViewCells" owner:self options:nil];
          cell = [topLevelObjects objectAtIndex:0];
      }
  
      cell.bodyTextView.text = [infoDictionary objectForKey:@"description"];
  
      return cell;
  }
  </code></pre>
  
  <p>Does anyone know what is happening here, and how to solve it?</p>
  
  <hr>
  
  <p>I tried adding this code after setting the text view text, to try to reset the links:</p>
  
  <pre><code>cell.bodyTextView.dataDetectorTypes = UIDataDetectorTypeNone;
  cell.bodyTextView.dataDetectorTypes = UIDataDetectorTypeAddress | UIDataDetectorTypeLink | UIDataDetectorTypePhoneNumber;
  </code></pre>
  
  <p>but it didn't change the behaviour that I'm seeing.</p>