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, everythin
As any of the above solutions worked for me, a workaround I've found is to create your UITextView
when you are supposed to update the text for each cell instead of reusing in the reusable cell.
Your code in the UITableViewCellDataSource
would be :
- (void)updateDescriptionWithText:(NSString *)descriptionText
{
UITextView *descriptionTV = [[UITextView alloc] initWithFrame:aFrame];
[descriptionTV setScrollEnabled:NO];
[descriptionTV setEditable:NO];
[descriptionTV setDataDetectorTypes:UIDataDetectorTypeLink];
if ([descriptionV respondsToSelector:@selector(setSelectable:)])
[descriptionTV setSelectable:YES];
[descriptionTV setText:descriptionText];
[self addSubview:descriptionTV];
}
And in the UITableViewCell
:
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
***your init code***
[cell updateDescriptionWithText:description];
}