回答

0

添加beginediting和endediting解決了這個問題

NSMutableAttributedString *attrUrl = [[NSMutableAttributedString alloc] initWithString:@"Hello world"]; 

[attrUrl beginEditing]; 
[attrUrl addAttribute:.....]; 

[attrUrl endEditing];