views:

313

answers:

1

Hi,

I have HTML string which is created using an xml file by a third party library. The HTML string contains custom URLs for images and videos (Ex:image://). Is there is way by I can handle these resource load request and load them correctly in UIWebView?

+1  A: 

You should be able to change them to a file:// url that points to a file inside the application bundle.

To get the path you can use:

NSString *path = [[NSBundle mainBundle] pathForResource:@"MyFileInResources" ofType:@".png"];

Note that you will need to escape this using:

NSString *escapedPath = [path stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding];
Alex Deem