Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8173231
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T22:04:12+00:00 2026-06-06T22:04:12+00:00

I am working with UIWebView project and I want to load an HTML file

  • 0

I am working with UIWebView project and I want to load an HTML file from a project resource. It is working fine when I run from the URL, but when I view the HTML file locally, JS files are not loaded. Loading the local HTML local file doesn’t refer to js files in UIWebView.

Here’s my code to load the HTML file project local resource and does’t refer the js file:

NSString *path = [[NSBundle mainBundle] pathForResource:@"textfile" ofType:@"txt"];
NSError *error = nil;
NSString *string = [[NSString alloc] initWithContentsOfFile:path encoding:NSUTF8StringEncoding error:&error];

NSString *path1 = [[NSBundle mainBundle] bundlePath];
NSURL *baseURL = [NSURL fileURLWithPath:path1];
NSLog(@"%@  >>> %@",baseURL,path);

[webview loadHTMLString:string baseURL:baseURL];

This code doesn’t find JS files in UIWebView, even though it loads image files from the project resource successfully.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-06T22:04:13+00:00Added an answer on June 6, 2026 at 10:04 pm

    i am find the problem is js files are not automatically copy to project bundles so, you can try follow instructions like below:

    go to your project target -> click tab to Bulid Phases -> expand the section copy Bundle Resources -> now find all files bin bundle resources of your project check your js files not copied,so, click + button and add js files manually on your project!

    now run the project working perfectly!

    like below screen shot:

    enter image description here

    after add js file in your project below screen shot:

    enter image description here

    welcome!

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm working on an iPhone project. I am getting an HTML fragment from an
I cannot get Raphaël working in a UIWebView. I load a simple HTML-Webpage with
I am working phonegap related project first .xib file i have webview from java
LoadHtmlString UIWebView is not working. I want to play embeded you tube video. I
Currently I'm working on to display Epub content in UIWebview . From this link
I am working on making a paged app that will load a separate HTML
I'm loading a URL from my own web site into a UIWebView in an
I got a problem with UIWebView. I want to render my own html code
I'm using html/javascript with iOS and UIWebView. I want to invoke an objective-c method
I got my uiwebview working and displaying the specified url. the only problem is

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.