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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T00:57:30+00:00 2026-06-04T00:57:30+00:00

I have a UIWebView which loads an HTML page which has some links to

  • 0

I have a UIWebView which loads an HTML page which has some links to the App Store (<a herf="http://itunes/bla/bla/bla"> type of links).

Clicking a link, opens external Safari, then opens external App Store app and successfully goes to correct page.

If you then click Home button and return to springboard and click on app again, it will briefly open to the the UIWebView that was displayed and then jump to external Safari and external App Store app again.

If you go back to app one more time it stays in the app.

So what is happening is that returning to app after opening external browser link from UIWebView HTML page, will then jump back to the same link a second time.

Anybody have any ideas what might be causing this?

Am using Xcode 4.2.1 and it happens in simulator as well as on an actual device (iPad 1 with iOS 4.3).

EDIT – SOLUTION:

Ok, here is what I had to do to solve the problem (Thanks to Ben’s response below who got me looking at the right areas):

This was my original method:

- (BOOL)webView:(UIWebView *)_webView shouldStartLoadWithRequest:(NSURLRequest *)request navigationType:(UIWebViewNavigationType)navigationType
{
    if (didLoad) { //Do not jump to URL when view first loads
        return YES;
    }

    [[UIApplication sharedApplication] openURL:[request URL]];
    return YES;
}

And this is my fixed method that does not keep jumping to URL:

- (BOOL)webView:(UIWebView *)_webView shouldStartLoadWithRequest:(NSURLRequest *)request navigationType:(UIWebViewNavigationType)navigationType
{
    if (didShowURL) { //Do not jump to URL when returning to app
        didShowURL = 0;
        return NO;
    }

    if (didLoad) { //Do not jump to URL when view first loads
       return YES;
    }

    didShowURL = 1;
    [[UIApplication sharedApplication] openURL:[request URL]];
    return YES;
}
  • 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-04T00:57:32+00:00Added an answer on June 4, 2026 at 12:57 am

    Your webview is being reloaded to its last page (the app store page) and is automatically redirecting the user away again. You just need to make sure that when the app is reloaded it is not trying to load the app store link again.

    Depending on your app setup you could use

    viewWillAppear
    

    And reload the original HTML page with the links every time the view is brought to the front.

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

Sidebar

Related Questions

I have an app with UIWebView which loads a remote HTML page...Now on this
I have a UIwebview which loads up a page ,first the links in the
I have a UIWebView containing html-formatted text. In the text some words are links.
In my app I have a UIWebView which loads different rtf files. I use
I have a uiwebview which loads documents from local file system. Some of the
I have an iPad UIWebView which has to display some rtfd.zip files. I try
I have an app with a UIWebView that loads different HTML files depending on
I have a UIWebView in my app which I want to use to display
I have a piece of HTML which I am displaying inside a UIWebView using
I have a UIWebView that loads a link, http://www.google.com/a/datacommsales.net . But I want to

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.