2 回答
1
highlightAllOccurencesOfString并且是在您尝试在对象上调用它们时removeAllHighlights定义的方法。试试这个:WBSecondViewControllerUIWebView
-(IBAction)searchButtonPressed:(id)sender{
NSLog(@"highlighttes");
[self highlightAllOccurencesOfString:@"不明"];
}
-(IBAction)clearHighlights:(id)sender{
[self removeAllHighlights];
}
这至少会编译。
于 2012-12-02T10:42:41.050 回答
1
这两行是错误的,
[_webView highlightAllOccurencesOfString:@"不明"];
[_webView removeAllHighlights];
它应该是,
[self highlightAllOccurencesOfString:@"不明"];
[self removeAllHighlights];
您正在尝试调用highlightAllOccurencesOfString并且在'sremoveAllHighlights中定义但在对象上。编译器无法在类中找到它,因此错误消息为WBSecondViewController@interfaceUIWebviewUIWebView@interfaceNo visible @interface for 'UIWebView' declares the selector ...
于 2012-12-02T10:43:24.730 回答