Mailing Lists: Apple Mailing Lists
Image of Mac OS face in stamp
WebKit BaseURL problems
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

WebKit BaseURL problems



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.




Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2011 Apple Inc. All rights reserved.