gpt4 book ai didi

iphone - 远程 html 文件完成加载时的 iOS webview 事件

转载 作者:行者123 更新时间:2023-11-29 13:36:42 26 4
gpt4 key购买 nike

当我使用以下方法将 .html 文件加载到 webview 并完成加载时,将触发事件 -(void)webViewDidFinishLoad:(UIWebView *)webView {

[webView1 loadRequest:[NSURLRequest requestWithURL:[NSURL fileURLWithPath:[[NSBundle mainBundle] pathForResource:@"/files/myFile" ofType:@"html"]isDirectory:NO]]];

但是,如果我远程加载相同的文件,则不会触发该事件!为什么?我该怎么做?谢谢。

[webView1 loadRequest:[NSURLRequest requestWithURL:[NSURL URLWithString:[urlBase stringByAppendingString:@".html"]]]];

最佳答案

最可能的原因是加载过程中出现错误。

尝试定义委托(delegate)方法 – webView:didFailLoadWithError: 看看会发生什么(如果它被调用而不是 didFinish)...

关于iphone - 远程 html 文件完成加载时的 iOS webview 事件,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/10417630/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com