We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
self.jsContext = [self.webView valueForKeyPath:@"documentView.webView.mainFrame.javaScriptContext"]; // 通过模型调用方法,这种方式更好些。 HYBJsObjCModel *model = [[HYBJsObjCModel alloc] init]; self.jsContext[@"OCModel"] = model; model.jsContext = self.jsContext; model.webView = self.webView; self.jsContext.exceptionHandler = ^(JSContext *context, JSValue *exceptionValue) { context.exception = exceptionValue; NSLog(@"异常信息:%@", exceptionValue); };
当我把以上代码放到[self.view addSubview:self.webView];之后 在JavaScriptObjectiveCDelegate添加方法 -(NSString *)getToken;
-(NSString *)getToken;
在HYBJsObjCModel里添加方法
-(NSString *)getToken{ return @"HYBJsObjCModel的token"; }
在test.html里添加方法
<script> var string = OCModel.getToken(); alert(string); </script>
会造成HYBJsObjCModel对象会泄露
The text was updated successfully, but these errors were encountered:
No branches or pull requests
当我把以上代码放到[self.view addSubview:self.webView];之后
在JavaScriptObjectiveCDelegate添加方法
-(NSString *)getToken;
在HYBJsObjCModel里添加方法
在test.html里添加方法
会造成HYBJsObjCModel对象会泄露
The text was updated successfully, but these errors were encountered: