单纯的Mark一下,以供入坑的小伙伴脱坑
NSString *jsFilePath = [[NSBundle mainBundel] pathForResource:@"XXX"ofType:@"js"];
NSString *jsStr = [[NSString alloc]initWithContentsOfFile:jsFilePath encoding:NSUTF8StringEncoding error:nil]
UIWebView *webView = [[UIWebView alloc]init];
[webView stringByEvaluatingJavaScriptFromString:jsStr];
[xxx addSubview:webView];
网友评论