I have to display an .html file which needs highcharts.js, jquery.min.js in order to display a graph. I am planning to display the .html file in a UIWebView.
I saw t
You will have to keep your files in your apps resources, the trick here is to maintain the relative linking of the JavaScript files with the HTML files. When adding your html package select "Create folder reference for any added folders". and call your html page like this in code:
NSString *filePath = [[NSBundle mainBundle] pathForResource:@"index" ofType:@"html" inDirectory:@"Help"];
NSURL *indexUrl = [NSURL fileURLWithPath:filePath];
Where all your Html pages (including css
, images
, js
) are in Help (or any other name you have) folder. i.e., its like maintaining a local static site inside the folder
You can boot http server locally (via for example https://github.com/robbiehanson/CocoaHTTPServer
) and set /<appPath>/Documents/yourFolder
as server root.
Then you can open in UIWebView
NSURL
like this: http://localhost:8080/index.html