Resources フォルダーに 2 つのローカル .html ファイルがあります。次の方法でロードしようとしていますが、最終ページのみがロードされます。私は何を間違っていますか?
ファイル = please_wait.html
これは機能しません。
NSError *error;
NSString* path = [[NSBundle mainBundle] pathForResource:@"please_wait" ofType:@"html"];
NSString* htmlString = [NSString stringWithContentsOfFile:path encoding:NSUTF8StringEncoding error:&error];
[webView loadHTMLString:htmlString baseURL:[NSURL fileURLWithPath:path]];
//Big "do-while" loop here. It works fine so I omitted it.
ファイル = update_graph.html
これは機能しません
path = [[NSBundle mainBundle] pathForResource:@"update_graph" ofType:@"html"];
htmlString = [NSString stringWithContentsOfFile:path encoding:NSUTF8StringEncoding error:&error];
[webView loadHTMLString:htmlString baseURL:[NSURL fileURLWithPath:path]];
//Lots of code removed. All works correctly and doesn't touch webview
この最後のものは完全に機能します。Google が表示します。
string = @"http://google.com";
NSURL *url = [NSURL URLWithString: string];
NSURLRequest *requestObj = [NSURLRequest requestWithURL:url];
[webView loadRequest:requestObj];