Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/cocoa/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Cocoa 如何访问应用程序&x27;s共享NSTextView_Cocoa_Osx Mountain Lion_Nstextfield_Nstextview - Fatal编程技术网

Cocoa 如何访问应用程序&x27;s共享NSTextView

Cocoa 如何访问应用程序&x27;s共享NSTextView,cocoa,osx-mountain-lion,nstextfield,nstextview,Cocoa,Osx Mountain Lion,Nstextfield,Nstextview,我想在所有文本字段的上下文菜单中添加一个菜单项。 如果我掌握了应用程序中所有NSTextField使用的NSTextView类型的内部字段编辑器,我就可以这样做。我能想到的唯一方法就是从[window firstResponder]访问它。 有人知道另一种方法吗?我能想到的另一种方法是通过重写menuForEvent方法对NSTextField进行子类化来扩展其行为 最后,在窗口委托中使用windowWillReturnFieldEditor方法返回自定义字段编辑器的实例。我可以想到的另一个方法

我想在所有文本字段的上下文菜单中添加一个菜单项。 如果我掌握了应用程序中所有NSTextField使用的NSTextView类型的内部字段编辑器,我就可以这样做。我能想到的唯一方法就是从[window firstResponder]访问它。
有人知道另一种方法吗?

我能想到的另一种方法是通过重写menuForEvent方法对NSTextField进行子类化来扩展其行为


最后,在窗口委托中使用windowWillReturnFieldEditor方法返回自定义字段编辑器的实例。

我可以想到的另一个方法是通过重写menuForEvent方法对NSTextField进行子类化,以扩展其行为

最后,在窗口委托中使用windowWillReturnFieldEditor方法返回自定义字段编辑器的实例