【发布时间】:2016-09-08 14:33:05
【问题描述】:
我使用了 NSTextView,并插入了图像 NSTextAttachment。当我选择并复制它,然后粘贴它时,它将在 textview 中显示粘贴的图像,但我无法从 NSTextView.attributedString 获取内容字符串。为什么?
【问题讨论】:
-
嘿,你找到解决办法了吗?
-
使用自定义类型修复这个问题: let newContent = content.replace(String(c), new: "", mode: .literal) NSPasteboard.general().addTypes([CustomParsteFormat.Emotion] , 所有者: nil) NSPasteboard.general().setString(newContent, forType: CustomParsteFormat.Emotion)
标签: cocoa nstextview