简体   繁体   English

NSTextView不起作用

[英]NSTextView not working

Hi Community, 嗨,社区,

I'm working with a NSTextView, and I can't tell you how frustrating it is. 我正在使用NSTextView,但无法告诉您它有多令人沮丧。 I'm using NSAttributedStrings, so I've set the textStorage to a variable, told it to begin editing, and then I've been using appendAttributedString on the textStroage. 我正在使用NSAttributedStrings,所以我已经将textStorage设置为一个变量,告诉它开始编辑,然后我一直在textStroage上使用appendAttributedString。 The first time I click the button to update the NSTextView, I get this error message: 第一次单击按钮更新NSTextView时,出现以下错误消息:

-[NSNull _isDefaultFace]: unrecognized selector sent to instance 0x7fff70bdefa0 -[NSNull _isDefaultFace]:无法识别的选择器已发送到实例0x7fff70bdefa0

the second time I click the button, the NSTextView goes completely blank, and when I click it (as if trying to select it's text), I get this message: 第二次单击该按钮时,NSTextView完全变为空白,并且当我单击它时(好像试图选择它的文本),我收到以下消息:

_NSLayoutTreeLineFragmentRectForGlyphAtIndex invalid glyph index 0 _NSLayoutTreeLineFragmentRectForGlyphAtIndex无效的字形索引0

What could be causing this?? 是什么原因造成的? I've been trying to get this work for a few hours now, so any help would be greatly appreciated. 我一直在努力进行这项工作了几个小时,因此,我们将不胜感激。 Thanks! 谢谢!

~Josh 〜乔什

I figured it out. 我想到了。 I have been trying to use two different font sizes and the NSTextView wasn't liking it 我一直在尝试使用两种不同的字体大小,但NSTextView不喜欢它

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM