I am trying to integrate TTTAttributedLabel into a UITableViewCell. It's really just a simple integration and all I wanted to was to substitute the old UILabel with TTTAttributedLabel. Here's what I did.
- Go to Storyboard and select the UILabel inside custom UITableViewCell and change its class to TTTAttributedLabel
Come back to the UITableViewController subclass, include TTTAttributedLabel.h, and modify
(UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
like this:static NSString *CellIdentifier = @"Post"; UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier]; if(cell == nil) cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:CellIdentifier]; TTTAttributedLabel *label = (TTTAttributedLabel *)[cell viewWithTag:801]; label.text = [self.post valueForKey:@"content"]; label.enabledTextCheckingTypes = NSTextCheckingTypeLink; label.userInteractionEnabled = YES; label.delegate = self; return cell;
But the link detection is not working. It's just plain text. How can I debug what I am doing wrong?