Apart from suggesting what I am using in my code:
[webView loadHTMLString:[....
baseURL:[NSURL fileURLWithPath:[[NSBundle mainBundle] bundlePath]]];
I cannot do much. Using [[[NSBundle mainBundle] bundlePath] stringByDeletingLastPathComponent]
is not correct, because that way you are moving upwards and outside the app bundle, but since you say you are trying many variants, I am not sure what could be.
If you want to try and troubleshoot what happens with your baseURL
, override webView:shouldStartLoadWithRequest:
and have a look at what files your web view attempts to open.
EDIT:
if you need accessing the Library folder of your app, this is the way to go (source)
NSArray *paths = NSSearchPathForDirectoriesInDomains(NSLibraryDirectory, NSUserDomainMask, YES);
NSString *libraryDirectory = [paths objectAtIndex:0];
[webView loadHTMLString:[....
baseURL:[NSURL fileURLWithPath:libraryDirectory]];
Anyway, from your comment: "they were previously downloaded by my app", you should already know how to go there... anyway, I suggest again to check what files are you trying to access in webView:shouldStartLoadWithRequest:
...