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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 10, 20262026-05-10T15:25:44+00:00 2026-05-10T15:25:44+00:00

I don’t want to take the time to learn Obj-C. I’ve spent 7+ years

  • 0

I don’t want to take the time to learn Obj-C. I’ve spent 7+ years doing web application programming. Shouldn’t there be a way to use the WebView and just write the whole app in javascript, pulling the files right from the resources of the project?

  • 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. 2026-05-10T15:25:45+00:00Added an answer on May 10, 2026 at 3:25 pm

    I found the answer after searching around. Here’s what I have done:

    1. Create a new project in XCode. I think I used the view-based app.

    2. Drag a WebView object onto your interface and resize.

    3. Inside of your WebViewController.m (or similarly named file, depending on the name of your view), in the viewDidLoad method:

      NSString *filePath = [[NSBundle mainBundle] pathForResource:@'index' ofType:@'html'];   NSData *htmlData = [NSData dataWithContentsOfFile:filePath];   if (htmlData) {     NSBundle *bundle = [NSBundle mainBundle];    NSString *path = [bundle bundlePath];   NSString *fullPath = [NSBundle pathForResource:@'index' ofType:@'html' inDirectory:path];   [webView loadRequest:[NSURLRequest requestWithURL:[NSURL fileURLWithPath:fullPath]]]; }
    4. Now any files you have added as resources to the project are available for use in your web app. I’ve got an index.html file including javascript and css and image files with no problems. The only limitation I’ve found so far is that I can’t create new folders so all the files clutter up the resources folder.

    5. Trick: make sure you’ve added the file as a resource in XCode or the file won’t be available. I’ve been adding an empty file in XCode, then dragging my file on top in the finder. That’s been working for me.

    Note: I realize that Obj-C must not be that hard to learn. But since I already have this app existing in JS and I know it works in Safari this is a much faster dev cycle for me. Some day I’m sure I’ll have to break down and learn Obj-C.

    A few other resources I found helpful:

    Calling Obj-C from javascript: calling objective-c from javascript

    Calling javascript from Obj-C: iphone app development for web hackers

    Reading files from application bundle: uiwebview

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

Sidebar

Related Questions

Don't know if it's I'm doing it wrong or if there's a bug (I
Don't know how to google for such, but is there a way to query
Don't ask why, but is there any way to suppress a failed linking error?
Don't overlook the 'date AND TIME' part though.
Don't know whats exactly going on, but it's definitely killing my time for nothing.
Don't overthink this - there's a very commonly used term and I ... have
Don't know what's wrong here, when I run the application it says Specified method
Don't shoot me, but it's the first time I saw a usage of a
Don't know if I worded the question right, but basically what I want to
Don't know why, but sometimes LocationManager is still working also after closing application. I

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.