Advertise Books Events Forum News Social Networking Support Us

sdkIQ for iPhone
($4.99)

Shape Up
($0.99)

Your First iPhone App
($1.99)

iVidCam Free
(free)

Kid Art
($0.99)

iPUBQUIZ
(£1.19)

ArtStudio
($3.99)

Want your application or service advertised on iPhone Dev SDK?

Go Back   iPhone Dev SDK Forum

View Single Post
Old 11-26-2008, 01:45 PM   #1 (permalink)
markww
Registered Member
 
Join Date: May 2008
Location: New York City, NY
Posts: 177
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
 
Enter the iPhone App Challenge!  Win $500!
» Advertisements
» Stats
Members: 24,298
Threads: 39,096
Posts: 171,402
Top Poster: smasher (2,575)
Welcome to our newest member, chrish2os
Powered by vBadvanced CMPS v3.1.0

All times are GMT -5. The time now is 01:01 PM.
Powered by vBulletin® Version 3.8.0
Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.