1
votes

I am working on xcode 8 beta and getting below error and not able to resolve.

Cannot invoke 'performSelector' with an argument list of type '(String)'

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
 }
1
Please post your full class. What is the object that has the selector webToNativeCall? Why not just call the function directly on self? You shouldn't need performSelector for that - JAL

1 Answers

2
votes

performSelector has been renamed perform(_ aSelector:):

class SomeClass: NSObject {

    func webToNativeCall() {
        // ...
    }

    func someFunc() {
        self.perform(#selector(webToNativeCall))
    }
}