How to load an local HTML file as string into UIWebView?

I'd like to use UIWebView's - (void)loadHTMLString:(NSString *)string baseURL:(NSURL *)baseURL

but I'm not sure what this baseURL is good for or how I would create that. My file is called localHTMLfile.html and I know how I would load this file the normal way:

NSURL *url = [[NSBundle mainBundle] URLForResource:@"localHTMLfile" withExtension:@"html"];
NSURLRequest *request = [NSURLRequest requestWithURL:url];
[webview loadRequest:request];

So it's just a raw guess, but would that baseURL be the NSURL object I've created already? Does that make sense?

1
задан Vladimir 28 September 2010 в 11:12
поделиться