无法将类型'UIView'的值转换为预期的参数类型'UIWebView' [英] Cannot convert value of type 'UIView' to expected argument type 'UIWebView'
问题描述
我使用cordova-plugin-iosrtc。
我遇到以下错误。
iOSRTCApp-master / platforms / ios / iOSRTCApp / plugins / cordova-plugin-iosrtc / iosrtcPlugin.swift:622:24:
无法将类型UIView的值转换为预期的参数类型
'UIWebView'
根据版本库,我不应该得到这个错误。
这是代码片段
let pluginMediaStreamRenderer = PluginMediaStreamRenderer(
webView:self.webView !,
eventListener:{(data:NSDictionary) - > Void in
let result = CDVPluginResult(status:CDVCommandStatus_OK,messageAsDictionary:data as [NSObject:AnyObject])
//允许更多回调。
result.setKeepCallbackAsBool(true);
self.emit(command.callbackId,result:result)
}
)
我试图将UIView强制转换为UIwebview,但这也没有发生。
解决方案这是一些版本不兼容的问题。
尝试安装以下cordova版本并添加iOS插件两者兼容
npm install -g cordova@5.2.0
cordova平台添加ios
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.
解决方案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
这篇关于无法将类型'UIView'的值转换为预期的参数类型'UIWebView'的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!