Hi, I just watched the UIWebView tutorial, which was really great! But I want to load html file from the local project folder, not from internet. How can I do that? I understand I only need to change the following line:
I am assuming there about fileURLWithPath class function of the NSURL, but I don't know the absolute path of the project folder and how to reference a file from it.
Lets say I have 10 pages of html that link to each other and I want to keep all those html files local. How can I use standard <a href> in the files to make sure that it uses the local files and not try to go to the web?
But how do you get the html-file that is located locally to load a resource (image, sound, etc), also located locally? Ive tried putting both a .wav and .png file in the resources-folder where I have my html-file, but it only manages to load the actual html-file without the other resources...
Ha funny. Read the documentation again. There are no subdirectories in projects.
Perhaps you misunderstood or I wasn't clear. I have two apps in the store right now that keep soundfiles in a sounds subdirectory. I just want to do the same for html files.
Given that "project" is the top level, any directories below "project" are what I'm talking about.
Have you actually read the documentation? Doesn't matter how intricately you arrange your resources in Xcode. They all end up lumped together in the same folder on the device.
The Xcode directories/folders are just for your convenience during coding. They don't even need a physical equivalency on the Mac. So the sequence is "intricate folder structure on Mac"-"different intricate project structure in Xcode"-"dumb flat list on device".
Have you actually read the documentation? Doesn't matter how intricately you arrange your resources in Xcode. They all end up lumped together in the same folder on the device.
The Xcode directories/folders are just for your convenience during coding. They don't even need a physical equivalency on the Mac. So the sequence is "intricate folder structure on Mac"-"different intricate project structure in Xcode"-"dumb flat list on device".
sorry about that. I guess I am just angry about their design decision.
Funny...I just ssh'ed to my application's directory on my iTouch and guess what: there were actual directories with my sound files. They were NOT lumped into the root of the project.
your original question was about HTML - why don't you try it out then, using an immediate redirect in your index.html file to a html file in a subfolder.
So you'd still call index.html, but would actually access a different file through a redirect (or a relative link on index.html)
I tried that too and it didn't work for me. Do your magic.
your original question was about HTML - why don't you try it out then, using an immediate redirect in your index.html file to a html file in a subfolder.
So you'd still call index.html, but would actually access a different file through a redirect (or a relative link on index.html)
I tried that too and it didn't work for me. Do your magic.
Well, I have no magic or I wouldn't be posting. If I did, I'd snap my fingers and have a million dollars in my account for the ultimate fart app Thanks for your replies, though.
I assume you meant bundlePath. [NSBundle mainBundle] is a singleton that refers to the main bundle of your app. On iPhone OS you can only have a single bundle but on MacOS its possible to have multiple bundles inside the main bundle and in fact you can load bundles from arbitrary paths. That's what bundleWithPath would do but it's obviously of no purpose on iPhone OS.
bundlePath, resourcePath and the related methods give you full paths to those directories. I'm not sure if the pathForResource methods will give you a path to a folder inside the bundle dir. They might. If they don't then you can build a path starting with mainBundle and using the methods in NSPathUtilities.h like stringByAppendingPathComponent.
I assume you meant bundlePath. [NSBundle mainBundle] is a singleton that refers to the main bundle of your app. On iPhone OS you can only have a single bundle but on MacOS its possible to have multiple bundles inside the main bundle and in fact you can load bundles from arbitrary paths. That's what bundleWithPath would do but it's obviously of no purpose on iPhone OS.
bundlePath, resourcePath and the related methods give you full paths to those directories. I'm not sure if the pathForResource methods will give you a path to a folder inside the bundle dir. They might. If they don't then you can build a path starting with mainBundle and using the methods in NSPathUtilities.h like stringByAppendingPathComponent.
Hi All,
I am novice on the ground of iphone application development.So my question is that i have made a presentation in html5 which includes different videos on different pages now i need to load these html files in my application locally.I am not able to access my html file locally imported in my project folder.My requirement is "how to load or call my local different html files(which are linked together)" into my project.
I have also used PhoneGap tool to achieve my target, but it does not help.
So please help me which would be highly appreciable.
Hey I just wanted to ask if there was a possibility of accessing more then one html at a time, in order to run a searching algorithm on many html files while still reading an html file. Currently I can run the search algorithm only on the opened html and I want to optimize the solution. If it is doable kindly give me hint of how to do it.
Thanks in advance