cocoa/osx - 子类化 NSTextView 和方法 -(BOOL)resignFirstResponder 光标问题
我正在为 NSTExtView 创建一个子类,并且在内部覆盖
-(BOOL)resignFirstResponder {
return YES;
}
一切正常,但是当响应者辞职时,它会在我的 textView 中留下一个闪烁的光标,而鼠标光标自由漫游(两个光标!)。有什么想法吗?
谢谢。
I am creating a subclass for NSTExtView and inside I am overiding
-(BOOL)resignFirstResponder {
return YES;
}
Everything works but when when the responder is resigned it leaves a blinking cursor in my textView while the mouse cursor roams free (two cursors!) . Any ideas?
Thanks.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
当您重写
NSTextView -resignFirstResponder
时,您将绕过会删除该光标的代码。您应该能够通过删除该方法或将代码替换为以下内容来解决光标问题:
When you override
NSTextView -resignFirstResponder
, you're bypassing the code that would remove that cursor.You should be able to fix the cursor problem by deleting that method or replacing your code with: