I insert an NSAttributedString into an NSTableView, and depending on its contents, I add attributes to the style dictionary.
- (id)tableView:(NSTableView *)aTableView objectValueForTableColumn:(NSTableColumn *)aTableColumn row:(NSInteger)rowIndex { NSAttributedString *theValue; NSMutableDictionary *attributes = [[NSMutableDictionary alloc] init]; [attributes setObject:[NSFont systemFontOfSize:11] forKey:NSFontAttributeName]; currentObject = [ticketsDataSource objectAtIndex:rowIndex]; if ([[currentObject valueForKey:aTableColumn.identifier] isKindOfClass:([NSString class])]) { NSString *currentValue = [currentObject valueForKey:aTableColumn.identifier]; if ([currentValue isEqualToString:@"resolved"]) { [attributes setObject:[NSColor colorWithCalibratedRed:0.344 green:0.619 blue:0.000 alpha:1.000] forKey:NSForegroundColorAttributeName]; } if ([previousValue isEqualToString:@"resolved"]) { [attributes setObject:[NSNumber numberWithInteger:NSUnderlinePatternSolid | NSUnderlineStyleSingle] forKey:NSStrikethroughStyleAttributeName]; } theValue = [[NSAttributedString alloc] initWithString:currentValue attributes:attributes]; previousValue = currentValue; }
As you can see, basically, what happens when he writes a line called "allowed", he knows that in the next column, which is the header column, gets crossed out. It works great, but for some reason, strikethrough does not draw all the text!
Here is the image:

What's going on here?
source share