问题描述
我正在mouseMove
中使用自定义NSTextView
事件,以将光标设置为超出内容插入范围的指针。当它在可编辑区域内时,我正在呼叫[super mouseMove]
:
- (void)mouseMoved:(NSEvent*)event {
NSPoint point = [self convertPoint:event.locationInWindow fromView:nil];
if ((point.x > self.textContainerInset.width &&
point.x < self.frame.size.width - self.textContainerInset.width)
) {
[super mouseMoved:event];
} else if (point.x > 10) {
[NSCursor.arrowCursor set];
}
}
在我的文本中选择一个换行符(表示一行末尾的空白部分)并在调用[super mouseMoved:event]
时将鼠标悬停在所选内容上时,我的应用会产生以下消息:
Appname[29357:853497] [Framework] Shared items array is empty
Appname[29357:853497] [Framework] No shared items can be accessed
我很困惑为什么会这样。我猜这不是最严重的错误,但是会使控制台无法使用,因为消息会在鼠标移动的每个像素处记录一次。我是在做错什么,还是应该使用其他方法来设置游标类型?
您可以在此处下载示例项目:
https://www.dropbox.com/s/fzjrjgv3rtf2lg7/HoverTest.zip?dl=1
解决方法
暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!
如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。
小编邮箱:dio#foxmail.com (将#修改为@)