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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T09:49:39+00:00 2026-05-23T09:49:39+00:00

So I have a sort of complex problem. I’m working on an iPad app

  • 0

So I have a sort of complex problem. I’m working on an iPad app for a web application. We have already created a mobile-friendly version of the web app, but would also like to have a native app, so that’s the current project.

The app has a relational grid it displays with entities used for analysis. The way to add entities in mobile safari and other desktop browsers is to click a link on the top of the app, which opens a popup with a search box. The user searches for the topic, and then checks off which entities to add to the grid. The user then hits a button within the popup, and the window disappears and populates the grid with the selected entities.

However, I’m having a lot of trouble figuring out how to have the two windows communicate. As of now, I have a new UIWebView open up when that particular link is clicked, but the parent-child connection is not made like it is in the browser version. Therefore I can select entities to add, but when I hit the button, the entities are not added to the grid. I’m not sure how to get around this.

Another issue is that after the link at the top of the page is clicked, I attempt to add entities, and then I go back to the original page, the link that should trigger the popup doesn’t work anymore.

Any help would be appreciated.

  • 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-23T09:49:40+00:00Added an answer on May 23, 2026 at 9:49 am

    If I understand correctly your issue, i.e., how to make to UIWebView send messages one another, I would that by creating an intermediate controller.

    Your controller would act as a UIWebViewDelegate for both UIWebViews and its responsibilities would be:

    1. creating the second UIWebView (hosting the popup window) by intercepting -webView:shouldStartLoadWithRequest:navigationType: (what I think you are already doing);

    2. intercept the click on your popup window and then using – stringByEvaluatingJavaScriptFromString: to retrieve whatever information it needs;

    3. pass that information to the first UIWebView by means of – stringByEvaluatingJavaScriptFromString:.

    I have no information as to what kind of data is passed back from the second page to the first one, so I cannot be more detailed.

    Anyway, I think that using a second UIWebView for the popup window will simply breaks the DOM parent/child relationship (because you have two of them), so you have to resort to some more manual processing or modify the design of your web app.

    EDIT:

    After reading your comment:

    1. UIWebView is really greedy as to touches. If intercepting clicks on links through -webView:shouldStartLoadWithRequest:navigationType: is not enough, you can resort to overriding -(void)sendEvent:(UIEvent*)event in your own UIWindow derived class; but this is necessary only if you mix a UIWebView and a, e.g., UIScrollView or when you want to handle multi-touches; look here for more info;

    2. here an example of how you can execute javascript:

      NSString *jsCall = [NSString stringWithFormat:@"yourFunction(%@);", arg];
      [webView stringByEvaluatingJavaScriptFromString:jsCall];

    You can use this in several different ways:

     `jsCall1 = @"var func = function(id) { var obj = document.getElementById(id); return id.value; }; func('dataObject');";
     `jsDataString = [popUp stringByEvaluatingJavaScriptFromString:jsCall1];
     `jsCall2 = NSString stringWithFormat:@"storeDataFromPopup(%@);", jsDataString];`
     `[parentUIWebView stringByEvaluatingJavaScriptFromString:jsCall1];`
    

    EDIT 2:

    A test suggestion: put the following code in your delegate class:

     - (void)webViewDidFinishLoad:(UIWebView*)webView {
        ....    
        NSString* aaa = [_label stringByEvaluatingJavaScriptFromString:@"f();"];
        NSLog(@"AAA: %@", aaa);
     }
    

    The HTML contains the following snippet:

     <script type='text/javascript'>function f() { alert('called!');} alert('javascript OK!');</script>"
    

    it will give you a first alert meaning that js parsing was ok, and a second meaning that the f function was called from webViewDidFinish. I did a simple text getting a web page and adding the javascript snippet to it, and it worked.

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

Sidebar

Related Questions

I have a sort of plug-in model in which various complex user controls are
I have sort of a tricky problem I'm attempting to solve. First of all,
here's a problem I just stumbled into: I have an php based web service
I have problem sorting my Gridview using my custom entity classes My complex entity
I have a reasonably complex Core Data app for the the iPhone. For the
i have have got an array of the complexe sort to store my navigation
So in nokia we can have sort of Microsoft Silverlight installed to system. We
I have a sort of tree structure that represent a hierarchy of layers in
I have to sort a number of integers, which can have values between 30.000.000
I have some sort of recursive function, but I need to parse a string,

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.