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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T10:29:52+00:00 2026-05-27T10:29:52+00:00

I am creating an iPhone/iPad app for the app store. What I’d like to

  • 0

I am creating an iPhone/iPad app for the app store. What I’d like to do is create it using HTML5/Javascript through a UIWebView so I can later use the HTML5/Javascript code for a web version as well (this is a requirement). I would like to have an offline database (SQLite) that basically ships with the app – this would be the content for the app and the .sqlite file would exist in the /Supporting Files/ folder of my XCode Project.

My question is, how can I run queries and get data back from this database from Javascript? Is this possible?

  • 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-27T10:29:53+00:00Added an answer on May 27, 2026 at 10:29 am

    You would have to build your own bridge or use one of the many HTML-based app frameworks available for iOS (PhoneGap, Appcelerator, etc).

    If you want to go down the path of building your own bridge, you should check out UIWebView‘s -stringByEvaluatingJavaScriptFromString:, and the combination of UIWebView‘s -loadRequest and UIWebViewDelegate‘s webView:shouldStartLoadWithRequest:navigationType: using a custom protocol (e.g., com.mycompany.myapp.1.0://) that you check for in the delegate method.

    EDIT:

    Here’s some sample code:

    Your HTML should have something like this:

    <a href="myapp://doQuery?arg1=a&arg2=b">Do Query</a>
    

    or:

    <a href="#" onclick:"javascript:doQuery();">Do Query</a>
    <script>
      function doQuery() {
        window.location = "myapp://doQuery";
      }
    </script>
    

    Then your webview delegate can capture a click there by:

    - (BOOL)webView:(UIWebView *)webView shouldStartLoadWithRequest:(NSURLRequest *)req (UIWebViewNavigationType)navType {
      if ([[req URL] scheme] == @"myapp:") {
        if ([[req URL] host] == @"doQuery") {
          // Do the query here.
          [webView stringByEvaluatingJavaScriptFromString:[NSString stringWithFormat:@"latestResult = %@; queryReturned(latestResult);", queryResultAsJSON]];
        } else if ([[req URL] host] == @"doSomethingElse") {
          // Do something else.
        }
        return NO;
      }
      return YES;
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I've been creating an iPhone App using Core Data. First of all, does it
I am creating an iphone performance app in which I would like to know
I'm creating an iphone app using xcode 4.2, and trying to use the AVFoundation
I'm working on a bitmap editor app for the iPad/iPhone and I'd like to
I am contemplating creating a realtime app where an iPod Touch/iPhone/iPad talks to a
I'm trying to do the basics steps of creating a universal (iphone/ipad) app in
I'm creating an iPad version of an iPhone app (NOT universal). I created copies
I'm converting my iPhone app to an iPad version, creating new XIBs for the
I am creating a very basic App for the iPhone & iPad and it's
I am creating an app which has version for both iPhone and iPad, iPad

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.