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

  • Home
  • SEARCH
  • 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 578173
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T14:13:56+00:00 2026-05-13T14:13:56+00:00

When Connected: I have a simple HTML page with some image elements that reference

  • 0

When Connected:
I have a simple HTML page with some image elements that reference images in a subdirectory as in (src=”images/someimage.jpg”). This page displays fine when accessed remotely via an internet connection.

When Offline:
I store the above HTML page locally to the apps documents directory for offline viewing. The local HTML page is loaded and displayed fine with the UIWebView — the PROBLEM is that the images in the HTML file are NOT displayed.

Possible Cause:
I guess the problem might be that the image paths (<img src="photo_files/..." />) are not resolved to absolute paths locally? How do I get it so that I can display local images in a UIWebView without modifying the html source? I don’t wanna have to go in there and manually change each of the image paths to the documents directory paths…How do I get the local images to display correctly on my UIWebView?

Question:
How do I get it so that I can display local images in a UIWebView without modifying the html source?

(Assume valid local paths …/Photos/photos.html, and Photos/photo_files/(image files).jpg all under the documents directory path)

HTML page source

…

<html>
<body>

<h1>Photo Gallery</h1>


<img src="photo_files/app_IMG_01.jpg" /><br />
<img src="photo_files/app_IMG_0100.jpg" /><br />
<img src="photo_files/app_IMG_0066.jpg" /><br />


</body>
</html>

Objective-C source

…

    NSFileManager* myManager = [NSFileManager defaultManager];  

    if([myManager fileExistsAtPath:[[self documentsDirectory] stringByAppendingPathComponent:@"/Photos/photos.html"]]){

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


        //Create a URL object.
        NSURL *url = [NSURL fileURLWithPath:[[self documentsDirectory] stringByAppendingPathComponent:@"/Photos/photos.html"] isDirectory:NO];
        //URL Requst Object
        NSURLRequest *requestObj = [NSURLRequest requestWithURL:url];
        //Load the request in the UIWebView.
        [webView loadRequest:requestObj];
  • 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-05-13T14:13:56+00:00Added an answer on May 13, 2026 at 2:13 pm

    I found out why this was not working for me. It was related to something totally different. UIWebView does not seem to have any problems with relative paths.

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

Sidebar

Ask A Question

Stats

  • Questions 308k
  • Answers 308k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer I believe "URL Rewriting Module for IIS" will solve your… May 13, 2026 at 9:38 pm
  • Editorial Team
    Editorial Team added an answer Spaces hurt. Anyway you should do: file_ext=$(echo $filename | awk… May 13, 2026 at 9:38 pm
  • Editorial Team
    Editorial Team added an answer Does Joomla have an API or web service you can… May 13, 2026 at 9:38 pm

Related Questions

I have created an Ajax enabled WCF web service that contains this simple method:
I am somewhat new to transactional databases and have come across an issue I
I have a wizard style interface where I need to collect data from users.
I have a datagrid all set up, connected to an XMLStore. When the user
I am sure there is a simple answer to this, but I am drawing

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

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.