1

When I load an .html file into webview using following method and finish its load, an event -(void)webViewDidFinishLoad:(UIWebView *)webView { is fired.

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

However, if I load same file remotely, that event is not fired! why? How could I do it? Thank you.

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

1 に答える 1

1

最も可能性の高い理由は、ロード中のエラーが原因です。

デリゲートメソッドを定義してみて、– webView:didFailLoadWithError:何が起こるかを確認してください(didFinishの代わりに呼び出された場合)...

于 2012-05-02T16:14:23.057 に答える