我正在尝试使用函数在HTML页面中调用一个JavaScript – View did load function { NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES); NSString *documentsDirectory = [paths objectAtIndex:0]; NSString *writablePath = [documentsDirectory stringByAppendingPathComponent:@"BasicGraph.html"]; NSURL *urlStr = [NSURL fileURLWithPath:writablePath]; NSFileManager *fileManager = [NSFileManager defaultManager]; NSString *myPathInfo = [[NSBundle mainBundle] pathForResource:@"BasicGraph" ofType:@"html"]; [fileManager copyItemAtPath:myPathInfo toPath:writablePath error:NULL]; [graphView loadRequest:[NSURLRequest requestWithURL:urlStr]]; } – (void) webViewDidFinishLoad:(UIWebView *)webView { [graphView stringByEvaluatingJavaScriptFromString:@"methodName()"]; […]