Advertise Mobile SDKs Books Events Forum News Social Networking Support Us
Follow @iphonedevsdk on Twitter

Mockup & CodeGen, iPhone & iPad
($9.99)

Make your own iPhone apps
and run them live!
(free)

Manu
($0.99)

Want your application or service advertised on iPhone Dev SDK?

Go Back   iPhone Dev SDK Forum

View Single Post
Old 11-26-2008, 02:45 PM   #1 (permalink)
markww
Registered Member
 
Join Date: May 2008
Location: New York City, NY
Posts: 178
Default printing the path to a file

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
markww is offline   Reply With Quote
 

» Advertisements
» Stats
Members: 158,716
Threads: 89,177
Posts: 380,480
Top Poster: BrianSlick (7,118)
Welcome to our newest member, Lfelipe
Powered by vBadvanced CMPS v3.1.0

All times are GMT -5. The time now is 11:03 AM.
Powered by vBulletin® Version 3.8.0
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.