views:

549

answers:

2

I'm trying to load images from the bundle to a uiwebview.

the code i'm currently using is

NSString *path = [[NSBundle mainBundle] bundlePath];
NSURL *baseURL = [NSURL fileURLWithPath:path];
[webView loadHTMLString:htmlString baseURL:baseURL];

when i open the view the application closes and opens safari and an error message pops with 'Safari cannot open the file. The error was: "file is directory".'

if i set the baseURL as nil then the page loads correctly (although without the images).

Any suggestions?

A: 

can you try this http://stackoverflow.com/questions/478665/link-to-resources-inside-webview-iphone

zapping
tried several of the solutions listed in the question but alas the same error occurs.
Rockett
A: 

Just installed the application onto an actual iphone - and it works correctly as expected, just in the iphone simulator UIWebView and bundle path doesn't work correctly.

Rockett