I'm trying to use a code similar to issue #58 and I'm getting a
EXC_BAD_ACCESS(code=1, address=0x0)
XWVScripting class:
class Bridge : NSObject, XWVScripting {
dynamic var ret: Int = 0
func getValue(_ promise: XWVScriptObject){
print("getValue")
ret = 2
promise.callMethod("resolve", with: [ret], completionHandler: nil);
}
JavaScript:
function updateRet(msg) {
ret = msg
}
function registerVars()
{
ret = 0;
if (ret==0) {
Bridge.getValue().then(function(result) {
updateRet(result)
});
}
}
I have also tried to do it like in issue #58:
func getValue(promiseObject promise: XWVScriptObject) {
//
}
But then I had another error, this time in JavaScript runtime saying that Bridge.getValue() was undefined.
I'm trying to use a code similar to issue #58 and I'm getting a
XWVScripting class:
JavaScript:
I have also tried to do it like in issue #58:
But then I had another error, this time in JavaScript runtime saying that Bridge.getValue() was undefined.