//需要加下划线的范围
NSRange contentRange = {11,10};
//将字符串转化成可变属性的字符串
NSMutableAttributedString *mutStr = [[NSMutableAttributedStringalloc] initWithString:self.label.text];
//添加下划线
[mutStr addAttribute:NSUnderlineStyleAttributeNamevalue:[NSNumbernumberWithInteger:NSUnderlineStyleSingle]range:contentRange];
self.label.attributedText = mutStr;