Ios ReplaceCharactersNSAttribute字符串的范围

Ios ReplaceCharactersNSAttribute字符串的范围,ios,objective-c,swift,nsattributedstring,nstextattachment,Ios,Objective C,Swift,Nsattributedstring,Nstextattachment,我想用另一个NSAttributedString替换NSAttributedString(其中包含NSTextAttachments)的子字符串(例如@“replaceString”) 我曾尝试使用NSMutableAttributedString的mutableString,但结果是忽略了其中的NSTextAttachments。下面的答案与我的案例不符 replaceCharactersRange:withAttributedString:?或者您是否有首字母NSAttributedStri

我想用另一个NSAttributedString替换NSAttributedString(其中包含NSTextAttachments)的子字符串(例如@“replaceString”)

我曾尝试使用NSMutableAttributedString的mutableString,但结果是忽略了其中的NSTextAttachments。下面的答案与我的案例不符


replaceCharactersRange:withAttributedString:
?或者您是否有首字母
NSAttributedString
、替换、结尾和最后一个的示例?“replaceCharactersRange:withAttributedString”有效。谢谢