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
Objective c 对于NSTextFinderClient';s contentViewAtIndex:有效的CharacterRange协议方法?_Objective C_Cocoa_Uiwebview_Nsscrollview_Objective C Protocol - Fatal编程技术网

Objective c 对于NSTextFinderClient';s contentViewAtIndex:有效的CharacterRange协议方法?

Objective c 对于NSTextFinderClient';s contentViewAtIndex:有效的CharacterRange协议方法?,objective-c,cocoa,uiwebview,nsscrollview,objective-c-protocol,Objective C,Cocoa,Uiwebview,Nsscrollview,Objective C Protocol,我已经实现了一个符合NSTextFinderClient协议的对象。textFinder的查找栏容器是一个WebView的WebDynamicScrollBarsView,它是一个NSScrollView。当我在我的WebView中显示查找栏时,它调用NSTextFinderClient's字符串的实现,在这里我返回WebView的document.body.innerText。当我在查找栏中键入时,TextFinder调用scrollRangeToVisible和contentViewAtIn

我已经实现了一个符合
NSTextFinderClient
协议的对象。
textFinder
的查找栏容器是一个
WebView
WebDynamicScrollBarsView
,它是一个
NSScrollView
。当我在我的
WebView
中显示查找栏时,它调用
NSTextFinderClient'
s字符串的实现,在这里我返回WebView的document.body.innerText。当我在查找栏中键入时,
TextFinder
调用
scrollRangeToVisible
contentViewAtIndex:effectiveCharacterRange
在我的
NSTextFinderClient
对象上查找匹配项并将其枚举,但没有突出显示任何内容

在这种情况下,为了使
textFinder
正确突出显示和滚动我的webview,我应该从我的webview/scrollview中为这两种协议方法返回什么

请注意,这是一个Mac应用程序,我标记了
uiwebview
,因为Mac的WebView对象没有标记,而WebView标记与Android相关