Objective c UITextView和NSMutableAttributedText

Objective c UITextView和NSMutableAttributedText,objective-c,ios7,nsattributedstring,nsmutableattributedstring,Objective C,Ios7,Nsattributedstring,Nsmutableattributedstring,UITextView使用NSAttributedString时显示格式化文本: NSAttributedString* s1 = [[NSAttributedString alloc] initWithString:@"Hello there!" attributes:@{NSForegroundColorAttributeName:[UIColor redColor], NSFontAttributeName: [UIFont p

UITextView
使用
NSAttributedString
时显示格式化文本:

NSAttributedString* s1 =
[[NSAttributedString alloc] initWithString:@"Hello there!"
                                attributes:@{NSForegroundColorAttributeName:[UIColor redColor], NSFontAttributeName: [UIFont preferredFontForTextStyle:UIFontTextStyleBody]}];
_textView.attributedText = s1;
但是,当我使用
NSMutableAttributedString
时,我看到附加的属性字符串没有格式化。仅显示初始化的字符串的格式

UIFont *font = [UIFont preferredFontForTextStyle:UIFontTextStyleBody]
    NSMutableAttributedString *emailBody = [[NSMutableAttributedString alloc] initWithString:@"" attributes:@{NSForegroundColorAttributeName:[UIColor redColor], NSFontAttributeName: font}];
if (_person.firstName.length > 0) {
    [emailBody appendAttributedString:[[NSAttributedString alloc]initWithString:_person.firstName attributes:@{NSFontAttributeName: [UIFont preferredFontForTextStyle:UIFontTextStyleCaption1]}]];
    [emailBody appendAttributedString:[[NSAttributedString alloc]initWithString:@"\n" attributes:nil]];
}
if (_person.lastName.length > 0) {
    [emailBody appendAttributedString:[[NSAttributedString alloc]initWithString:_person.lastName attributes:@{NSFontAttributeName: [UIFont preferredFontForTextStyle:UIFontTextStyleCaption2]}]];
    [emailBody appendAttributedString:[[NSAttributedString alloc]initWithString:@"\n" attributes:nil]];
}

为什么?

NSAttributedString
附加到
NSMutableAttributedString
时,它有自己的属性。

NSAttributedString
附加到
NSMutableAttributedString
时,它有自己的属性