load local HTML file when link is clicked in WebView
问题 I have a WebView that loads a local HTML file like this: [webView loadRequest:[NSURLRequest requestWithURL:[NSURL fileURLWithPath:[[NSBundle mainBundle] pathForResource:@"test1" ofType:@"html"]isDirectory:NO]]]; What I want is to click a link in the test1 local HTML file and then for the webView to load the test2 local HTML file. How can I do this? 回答1: Like in a regular webpage. Let the link in test 1 point to test2. 回答2: Instead of loading a request, use the - (void)loadHTMLString:(NSString