
NSMutableAttributedString* attributedString = [_textFIEld.attributedText mutablecopy];NSMutableDictionary* dict = [_homeFeedCommentsVIEwController.inputData.array_extraElements objectAtIndex:0];NSNumber* indexObject = [NSNumber numberWithUnsignedLong:attributedString.length];[dict setobject:indexObject forKey:@"LocationIndex"];[attributedString insertAttributedString:imageAsAttributedString atIndex:attributedString.length];
我现在如何获得该文本附件&在图像应该位于文本正文的位置用字符串替换它?
解决方法 只需告诉文本存储,您更新了相应附件字符范围的属性:textStorage.edited([.EditedAttributes],range: range,changeInLength: 0)总结
以上是内存溢出为你收集整理的ios – 如何在NSAttributedString中删除和替换NSTextAttachment全部内容,希望文章能够帮你解决ios – 如何在NSAttributedString中删除和替换NSTextAttachment所遇到的程序开发问题。
如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。
欢迎分享,转载请注明来源:内存溢出
微信扫一扫
支付宝扫一扫
评论列表(0条)