Cannot convert value of type 'UIView' to expected argument type 'UIWebView'

爷,独闯天下 提交于 2019-12-10 17:33:53

问题


I am using cordova-plugin-iosrtc.

I am experiencing the following error.

iOSRTCApp-master/platforms/ios/iOSRTCApp/Plugins/cordova-plugin-iosrtc/iosrtcPlugin.swift:622:24: Cannot convert value of type 'UIView' to expected argument type 'UIWebView'

According to repository,I should not get this error.

Here is the code snippet

let pluginMediaStreamRenderer = PluginMediaStreamRenderer(
            webView:self.webView!,
            eventListener: { (data: NSDictionary) -> Void in
                let result = CDVPluginResult(status: CDVCommandStatus_OK, messageAsDictionary: data as [NSObject : AnyObject])

                // Allow more callbacks.
                result.setKeepCallbackAsBool(true);
                self.emit(command.callbackId, result: result)
            }
        )

I tried to cast UIView to UIwebview but that's also not happening.


回答1:


This is some version incompatibility problem.

Try to install the following cordova version and add the iOS plugin both are compatible

npm install -g cordova@5.2.0
cordova platform add ios


来源:https://stackoverflow.com/questions/39677167/cannot-convert-value-of-type-uiview-to-expected-argument-type-uiwebview

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!