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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T19:13:39+00:00 2026-05-15T19:13:39+00:00

In my iPhone app, I have a UIWebView where I’m loading a local html.

  • 0

In my iPhone app, I have a UIWebView where I’m loading a local html. Everything works up just fine, but now I want to be able to handle local links (to footnotes): when I click on a local link, I want to be able to jump to the footnote refered by it, then be able to come back.

<a href="#tofootnote">jump to footnote</a>

I handled this by adding my code to shouldStartLoadWithRequest and intercepting local link clicks; when a local link is clicked, I work my magic (hide some ui elements, add a back button, etc..); clicking on the back button jumps me back to the original location in the html document.

The problem is that clicking ONCE AGAIN on the link no longer calls shouldStartLoadWithRequest. I.e., the following code:

- (BOOL)webView:(UIWebView *)webView shouldStartLoadWithRequest:(NSURLRequest *)request navigationType:(UIWebViewNavigationType)navigationType {
 NSLog(@"foo bar");
 return YES;
}

only displays “foo bar” ONCE (actually, twice – the first time when I’m initially loading the document), but only ONCE afterwards, regardless of how many times I’m clicking on the local link

So, unless anyone has a better explanation, I’m guessing that the UIWebView caches the doc or link or something and no longer calls the handler after the initial call; If this is the case, how can I clear this internal cache up? (without reloading the document)

  • 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-15T19:13:39+00:00Added an answer on May 15, 2026 at 7:13 pm

    The only solution I’ve found for this problem is to string-replace all the anchors from
    “#anchor” to something that is considered a URL, like “|anchor”. This way UIWebView will think it’s a real link and attempt the request when clicked. This solution obviously will only work if you are handling all the clicks yourself and hence can interpret the changed anchors. I can understand the reason for the behavior of UIWebView, but it is rather frustrating. The delegate really needs messages to match the onclick, etc. handlers.

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

Sidebar

Related Questions

in my iPhone app, I have an UIWebView with some simple HTML links to
I have this UIWebView on my app that shows a local html file. Do
I have a native iPhone app that just loads a website using UIWebView .
I have an old iPhone app and now want to migrate it to an
I have a UIWebView in an iPhone app and want to intercept structured mailto-URLs
I have a native iPhone app loading a cached jQTouch web app inside UIWebView.
I'm displaying some HTML content in my iPhone app using a UIWebView. I have
I have a UIWebView in my iPhone app that have a web page with
I have an app which existed as an iPhone app first and now as
I'm a relative newbie on iPhone app development but have successfully created a tab

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.