WebKit BaseURL problems
WebKit BaseURL problems
- Subject: WebKit BaseURL problems
- From: Jon Raphaelson <email@hidden>
- Date: Tue, 27 Jul 2004 04:36:26 -0600
I searched in the archives for anything quite like this but I couldn't
find anything. Also, I'm sorry if this sounds newbish...
I am working an an HTML editor with live previewing. Basically I have a
Document Based app, with a textView and webView in the document window.
I want the webView to show the contents of the textView as a webpage,
with a baseURL of the documents path. This is what I have...
...
if([self fileName])
{
basePath = [[NSString alloc] initWithString:[[self fileName
stringByDeletingLastPathComponent]];
NSLog(@"basePath on open: %@", basePath);
}
...
...
NSURL *baseURL;
if(basePath != nil) baseURL = [[NSURL alloc]
initFileURLWithPath:basePath];
else baseURL = nil;
NSLog(@"baseURL: %@", baseURL);
[[webView mainFrame] loadHTMLString:[textView string] baseURL:baseURL];
Now the live preview works so long as baseURL is nil, but if I try and
use a NSURL that points to somewhere like 'Users/jon/Sites' then it
chokes. I get no error messages, just nothing rendered in the webview.
Any ideas?
Thanks ahead of time,
Jonathan Raphaelson
email@hidden
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.