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

The Archive Base Latest Questions

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

So my class has two different UIWebView objects (one is a menu the other

  • 0

So my class has two different UIWebView objects (one is a menu the other is for content). Let’s call them UIWebView “A” and UIWebView “B”

In my shouldStartLoadWithRequest how do i determine which UIWebView a link was called from?
Was it “A” or “B”?
I thought i could just check a property like “title” or “name” so i looked through the documentation but no such luck.

I’m looking for something like this…

- (BOOL)webView:(UIWebView*)webView shouldStartLoadWithRequest:(NSURLRequest*)request navigationType:(UIWebViewNavigationType)navigationType {
NSLog(@"WebView is... %@",[webView title]);
}

If i log the entire webView i get a large hash but no reference to the original name i gave it in my IBOutlet. Hope this makes sense.

Also, could someone point me to how i would find this kind of properties in the documentation because it seems like a pretty basic thing i am trying to do.

  • 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-26T00:13:15+00:00Added an answer on May 26, 2026 at 12:13 am

    You can just test if the webView parameter passed to that method is equal to the ivars you declared.

    For example, if the ivars for the IBOutlets are named webViewA and webViewB:

    - (BOOL)webView:(UIWebView *)webView shouldStartLoadWithRequest:(NSURLRequest *)request navigationType:(UIWebViewNavigationType)navigationType
    {
        if (webView == webViewA)
            NSLog(@"webview A wants to load %@", request);
        else
            if (webView == webViewB)
                NSLog(@"webview B wants to load %@", request);
            else
                NSLog(@"some other webview wants to load %@", request);
    
        return YES;
    }
    

    Alternatively, you can also set the tag property of each web view either in IB or code to some non-zero values (say 10 and 20) and check the value of webView.tag in the delegate method.

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

Sidebar

Related Questions

why java Object class has two methods hashcode() and equals()? One of them looks
I've two different template classes. One of them has a member function that returns
I have a NIB with two NSWindow objects. The controller class has two IBOutlets,
I have a class which has two HashSet<String> collections as private members. Other classes
I have a base class, B, which has two constructors, one with no paremeters
Assume two different scenarios: a) Each (service) class X has an interface X and
I have a class that has two functions, both of which take a different
I have two different java projects (I'll call them project 1 and Project 2
I have two classes defined in different h files and each class has some
I've got a class representing an interval. This class has two properties start and

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.