使用NSMutableParagraphStyle和NSAttributeString类
NSMutableParagraphStyle*style = [[NSParagraphStyle defaultParagraphStyle] mutableCopy];
//对齐方式
style.alignment = NSTextAlignmentLeft;
//首行缩进
style.firstLineHeadIndent=40.0f;
NSAttributedString*attrText = [[NSAttributedString alloc] initWithString:@"shibushisssssss我们就是shibushisssssss我们就是11111111" attributes:@{NSParagraphStyleAttributeName: style}];
self.contentlabel.numberOfLines =0;
self.contentlabel.attributedText = attrText;
运行效果: