What I did in the past uses this code when loading HTML
NSString *bundlePath = [[NSBundle mainBundle] bundlePath]; NSURL *baseURL = [NSURL fileURLWithPath:bundlePath]; [webView loadData:data MIMEType:@"text/html" textEncodingName:@"utf-8 " baseURL:baseURL];
This will pass the package location as the base URL, which should result in your relative URLs working correctly. Of course, you do not need to use this exact loadData method, there are various overloads. Just take baseUrl there and you should be good to go.
If all else fails, you can use something like:
NSString *path = [[NSBundle mainBundle] pathForResource:@"file.css" ofType:nil]]
And add this to the page with some line replacements or whatever. Bit is hacked though.
source share