Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/python-2.7/5.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Xcode 将html文件从资源加载到webview applescript_Xcode_Applescript Objc - Fatal编程技术网

Xcode 将html文件从资源加载到webview applescript

Xcode 将html文件从资源加载到webview applescript,xcode,applescript-objc,Xcode,Applescript Objc,我想将本地html文件从参考资料加载到applescript objc应用程序的web视图中。 我已经将这些文件添加到捆绑资源中,但我不确定如何使用类似的方式将它们加载到web视图中 tell myWebView to setMainFrameURL_("file.html") 很抱歉这个小问题,如果您需要任何帮助,我们将不胜感激 将WebKit.framework添加到应用程序常规设置中的链接框架和库部分。没有这一点,我就出现了无法解码WebView类对象的错误 创建一个出口。这是让Appl

我想将本地html文件从参考资料加载到applescript objc应用程序的web视图中。 我已经将这些文件添加到捆绑资源中,但我不确定如何使用类似的方式将它们加载到web视图中

tell myWebView to setMainFrameURL_("file.html")

很抱歉这个小问题,如果您需要任何帮助,我们将不胜感激

将WebKit.framework添加到应用程序常规设置中的链接框架和库部分。没有这一点,我就出现了无法解码WebView类对象的错误

创建一个出口。这是让Applescript与UI元素对话所必需的

在AppDelegate.applescript中写入属性myWebView:缺少值并保存它。 使用Interface Builder视图connect CTRL将应用程序代理与Web视图一起拖动,然后选择myWebView。 现在,myWebView属性直接指向您的Web视图。 告诉WebView从应用程序的资源文件夹加载HTML文件:

set appResourcesPosixPath to POSIX PATH of (path to current application as text) & "Contents/Resources/"
tell myWebView to setMainFrameURL_(appResourcesPosixPath & "File.html")

享受吧,迈克尔/汉堡

我在用applescript objc寻找解决方案