1

I have a image say point.png in folder ABC in resourse.

I want to show that image in html

NSString *myFilePath=   [[NSBundle mainBundle] pathForResource:@"Point1" ofType:@"png"];
NSMutableString *strForWebView = [NSString stringWithFormat:@"<html>"
                                          "<head><b>%@</b></head><br>"
                                          "<img src= %@ height='30' width='30' />"
                                          , [[play quotations] objectForKey:@"Heading"], myFilePath, .......

SO now what should i do so that it picks the path of image...in html from which it is loaded in web view...

pls help

Thanks

Rohit Singhal
  • 381
  • 1
  • 4
  • 22
  • go to this link. I hope that this will help you http://[stackoverflow.com/questions/6420925/load-resources-from-relative-path-using-local-html-in-uiwebview][1] [1]: http://stackoverflow.com/questions/6420925/load-resources-from-relative-path-using-local-html-in-uiwebview – Mary Jul 12 '12 at 12:08

1 Answers1

0

With your approach that is critically important to give the correct baseUrl to load the webView.

If you need the base url to be not local to load some external data, consider displaying images via base64 presentation, i gave the details how you can do it in this answer.

At the OP of this thread you will also see how the base url must be used if you want to display the local content only.

Community
  • 1
  • 1
A-Live
  • 8,904
  • 2
  • 39
  • 74