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 9255827
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T11:47:50+00:00 2026-06-18T11:47:50+00:00

I use a UIWebView to load a local html, and there is a PNG

  • 0

I use a UIWebView to load a local html, and there is a PNG file inside the html created by Objc.

After the PNG file has been modified, I reload the html in UIWebView, but the image doesn’t change. However, if I quit the app and reopen it, the image file will be changed to the new one.

I have checked the PNG file in Documents with Finder, so I’m sure it has been modified, but the old one is still in UIWebView.

So, as I think that it’s a UIWebView cache problem, I’ve tried:

  • [[NSURLCache sharedURLCache] removeAllCachedResponses];

  • [_webView loadRequest:[NSURLRequest requestWithURL:[NSURL fileURLWithPath:url isDirectory:NO ] cachePolicy:NSURLRequestReloadIgnoringLocalAndRemoteCacheData timeoutInterval:1]]; or NSURLRequestReloadIgnoringCacheData

None of them works, and I can’t change the filename, because the PNG file is used in a lot of places (other html and objc code).

I’ve tried this too:
some.png?r=randomNumber
but it can’t be showed.

How do I clear the UIWebView cache when using a local image file inside a local html?

  • 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-18T11:47:52+00:00Added an answer on June 18, 2026 at 11:47 am

    You can try this, in your AppDelegate.m

    +(void)initialize {
      [[NSURLCache sharedURLCache] setDiskCapacity:0];
      [[NSURLCache sharedURLCache] setMemoryCapacity:0];
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I want to use UIWebView to load a html url, but don't load the
I use and UIWebView in my application to load www.google.com. After the page is
Is there any way to use Apple In App purchases from a UIWebView inside
My app use a UIWebView to load a website and download file when user
I want to use UIWebView to load URL and play vedios. When I press
Can I download a PDF file and shows it without use UIWebView? I need
There's a load of questions which ask this: Can I get UIWebView to view
I use UIWebView to load web from a webLink and UIWebViewDelegate to control error
I am creating an ePub reader on IOS. Basically, I use uiwebview to load
I use UIWebView as a subView of UIView to load animation image(GIF) from server.

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.