Loading local images in a UIWebView

I ran into this problem were I could not get a local image to appear in a UIWebView. It turns out that in order to enable this functionality you need to tell the webview where to look for these images, in the below example we tell it to use the main bundle:

    NSString *bundlePath = [[NSBundle mainBundle] bundlePath];
    NSURL *bundleBaseURL = [NSURL fileURLWithPath: bundlePath];

    UIWebView *webview = [[UIWebView alloc] initWithFrame:self.view.frame];
    [webview loadHTMLString:self.content baseURL:bundleBaseURL];

And the corresponding HTML line:

<img src="nameOfImage.png" />