title: TTT attributed Label Multi- colored Font help
body: <pre><code>-(UITableViewCell*) makeLikeCell
   {
      // Load the top-level objects from the custom cell XIB.
  NSArray *topLevelObjects = [[NSBundle mainBundle]      loadNibNamed:@"SpotlightLikesTableViewCell" owner: self options: nil];
  
  // Grab a pointer to the first object (presumably the custom cell, as that's all the XIB should contain).
  UITableViewCell *cell = [topLevelObjects objectAtIndex:0];
  
  
  NSString *likeText = [likesAndComments objectAtIndex: kLikeRow];
  
  TTTAttributedLabel *likeLabel = [[[TTTAttributedLabel alloc] initWithFrame:CGRectZero] autorelease];
  likeLabel = (TTTAttributedLabel*) [cell viewWithTag: kCaptionTag];
  likeLabel.textColor = [UIColor blueColor];
  likeLabel.lineBreakMode = UILineBreakModeWordWrap;
  [likeLabel setFont: [UIFont fontWithName: @"Helvetica Neue" size: 10]];
  
  [likeLabel setText: likeText afterInheritingLabelAttributesAndConfiguringWithBlock: ^NSAttributedString *(NSMutableAttributedString *mutableAttributedString) {
      NSRange colorRange = [[mutableAttributedString string] rangeOfString: @" like this photo." options: NSCaseInsensitiveSearch];
  
      [mutableAttributedString addAttribute:(NSString *) kCTForegroundColorAttributeName value:(id)[[UIColor grayColor] CGColor] range:colorRange];
      return mutableAttributedString; }];
  
  return cell;
  }
  </code></pre>
  
  <p>I added the TTT attributed label to my project.  I want to have 2 different font colors to display the "likes".  However my project keeps crashing.  A sample string to be formatted would be: "andrew, john, amos likes this photo."</p>
  
  <p>any suggestions?
  <img src="https://i.stack.imgur.com/ZMDby.png" alt="enter image description here"></p>