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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T16:20:14+00:00 2026-06-11T16:20:14+00:00

I have a UIWebView embedded within an iPhone app I am developing. I am

  • 0

I have a UIWebView embedded within an iPhone app I am developing.
I am trying to make the links open in Safari by using target=”_blank” on anchors.

I see that the target property is ignored by the UIWebView, links do not open in a new Safari instance. Why is that?

I know that in order to make this work I have to use shouldStartLoadWithRequest.

  • 1 1 Answer
  • 1 View
  • 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-11T16:20:16+00:00Added an answer on June 11, 2026 at 4:20 pm

    You should use openURL to make Safari open a web page from your app:

     [[UIApplication sharedApplication] openURL:[NSURL URLWithString:@"http://..."]];
    

    If you want to “intercept” the tap on a given link and open Safari with that URL, you can use, as you say, shouldStartLoadWithRequest. I would suggest to use a custom scheme for the protocol of your URL, so you can differentiate links that should open in Safari from links that can be open in your UIWebView:

     - (BOOL)webView:(UIWebView*)webView shouldStartLoadWithRequest:(NSURLRequest*)request navigationType:(UIWebViewNavigationType)navigationType {
    if ([[[request URL] scheme] isEqual:@"safari"])
        [[UIApplication sharedApplication] openURL:[NSURL stringByReplacingOccurrencesOfString:@"safari://" withString:@"http://"]];
    
     }
    

    In this case, you would specify your urls in the HTML page as “safari://…”

    Otherwise, simply call openURL passing the full URL to it.

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

Sidebar

Related Questions

I have a UIWebView with links in the text which open Safari if pressed.
I have a UIWebView in my iPhone app that have a web page with
I have a embedded uiwebview in my app which will in turn call a
I have an small embedded UIWebView for my about-section of the app. When the
I have a UIWebView in my app which I want to use to display
I have a UIWebView containing html-formatted text. In the text some words are links.
I have a UIWebView in my app linked to the url of a blog
I'm trying to launch embedded Youtube videos from a UIWebView, but get this error
I have a UIWebView which is embedded in a UIScrollView. The webView is resized
I have a ViewController embedded in a NavigationController. The ViewController has a UIWebView that

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.