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

Interface 2, Advanced iOS
Mockup & Code Gen
($9.99)

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

Pic Frame Dynamo: Photo Editing
($0.99)

Abiliator
($1.99)

Want your application or service advertised on iPhone Dev SDK?

Go Back   iPhone Dev SDK Forum

View Single Post
Old 08-31-2009, 01:15 PM   #6 (permalink)
michelle
Registered Member
 
Join Date: Apr 2009
Location: michigan
Posts: 197
michelle is on a distinguished road
Default

Quote:
Originally Posted by starwarsdevwookie59 View Post
Thanks so much for your reply!

I was able to get the index.html to load in the webview and use the sources. here's the code I ended up using:

NSString *filePath = [[NSBundle mainBundle] pathForResource:@"index" ofType:@"html"];
NSData *htmlData = [NSData dataWithContentsOfFile:filePath];
if (htmlData) {
NSBundle *bundle = [NSBundle mainBundle]; NSString *path = [bundle bundlePath]; NSString *fullPath = [NSBundle pathForResource:@"index" ofType:@"html" inDirectoryath];
[web loadRequest:[NSURLRequest requestWithURL:[NSURL fileURLWithPath:fullPath]]]; }


I got it to load in the webview, just one problem... IT DOESNT RESPOND TO ANYTHING. It loads great with all the images and such, just when i click/touch something, it doesn't do anything.

Any help is appreciated. thanks.

I feel particularly generous today, here's my code that works.. I think you are missing the base uril for one thing.

NSString *filePathString = [[NSBundle mainBundle] pathForResource:@"index" ofType:@"html"];
NSMutableString *html = [[NSMutableString alloc] initWithContentsOfFile: filePathString];
[html replaceOccurrencesOfString: @"urlvar" withString:urlString
options: NSLiteralSearch range: NSMakeRange(0, [html length])];
// NSLog(html);
NSURL *aURL = [NSURL fileURLWithPath:filePathString];
[webView loadHTMLString:html baseURL:aURL];
michelle is offline   Reply With Quote
 

» Advertisements
» Stats
Members: 175,179
Threads: 93,919
Posts: 402,150
Top Poster: BrianSlick (7,967)
Welcome to our newest member, Scottaclod
Powered by vBadvanced CMPS v3.1.0

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