How to load a LOCAL.html file using UIWebview?

I am trying to load an HTML file stored locally in the application document directory using the method shown below. This does not work. What am I doing wrong?

    NSLog(@"Loading Saved Copy!");
urlAddress = [[self documentsDirectory] stringByAppendingPathComponent:@"/Profile/profile.html"];


            //Create a URL object.
            NSURL *url = [NSURL URLWithString:urlAddress];
            //URL Requst Object
            NSURLRequest *requestObj = [NSURLRequest requestWithURL:url];
            //Load the request in the UIWebView.
            [webView loadRequest:requestObj];
+3
source share
1 answer

Use +[NSURL fileURLWithPath:isDirectory:]instead.

+4
source

Source: https://habr.com/ru/post/1730733/


All Articles