对于您可能想要使用的范围:
NSMakeRange (0,mat.length);
喜欢这个:
NSMutableAttributedString *mat = [self.tableLabel.attributedText mutablecopy];
[mat addAttributes:@{NSUnderlinestyleAttributeName: @(NSUnderlinestyleSingle)} range:NSMakeRange (0,mat.length)];
self.tableLabel.attributedText = mat;