开发者

NSTextView determine if NSTextAttachment is present

开发者 https://www.devze.com 2022-12-21 03:42 出处:网络
in my MyDocument class I need to determine if there is an image in my NSTextView, so I can prevent users fr开发者_如何学Com saving documents as RTF although RTF doesn\'t support images.

in my MyDocument class I need to determine if there is an image in my NSTextView, so I can prevent users fr开发者_如何学Com saving documents as RTF although RTF doesn't support images.

Could someone point me in the right direction?


Is there a reason you can't support RTFD for documents with images, like TextEdit does?

If that really isn't an option, ask your attributed string whether it contains attachments. That's what embedded images are: attachments.

Also, you shouldn't use your views as storage classes. The document itself should own the text and expose it in a property, and you should bind the text view's value to that property.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号