【发布时间】:2016-06-14 10:57:52
【问题描述】:
我正在使用 xcode 8 beta 并遇到错误且无法解决。
无法使用“(字符串)”类型的参数列表调用“performSelector”
func webView(WebViewNews: UIWebView!, shouldStartLoadWithRequest request: NSURLRequest!, navigationType: UIWebViewNavigationType) -> Bool {
if request.URL!.absoluteString.hasPrefix("ios:") {
// Call the given selector
self.performSelector("webToNativeCall")
// Cancel the location change
return false
}
return true
}
【问题讨论】:
-
请发布您的完整课程。具有选择器
webToNativeCall的对象是什么?为什么不直接在self上调用函数呢?你不应该为此需要performSelector
标签: ios xcode swift swift3 xcode8