Hi,
I've got a local html file I'm displaying in a UIWebView. I set that up like:
Code:
[m_webview loadRequest:[NSURLRequest requestWithURL:[NSURL fileURLWithPath:[[NSBundle mainBundle] pathForResource:@"test" ofType:@"html"]isDirectory:NO]]];
Now inside test.html, I want to import a javascript file which is also just in my main project directory, I tried this inside the html:
Code:
<script type="text/javascript" charset="utf-8" src="test.js"></script>
but that does not work, I guess I have to give it the absolute path to the javascript file. I tried doing this to figure it out:
Code:
NSString* info = [[NSURL fileURLWithPath:[[NSBundle mainBundle] pathForResource:@"test" ofType:@"js"]isDirectory:NO] absoluteString];
NSLog(info);
but I get some wild characters printed out to the console. How do you print out the absolute path correctly?
Thanks