I am trying to show an image from my Resources directory on a UIWebView
along with toms text.
I create the UIWebView using loadHTMLString:baseURL:.
The string I pass has all of my content in html - the img tag and
text. The text gets displayed but the image is shown as a broken link
(in the
Forgot to add:
I am accessing the image file like this
NSString *imageName = [[NSBundle mainBundle] pathForResource:@myImage
ofType:@png];
I have confirmed (using NSLog) the path printed in the img tag is correct
img align=center src=/Users/hrishi/Library/Application
Support/iPhone
Post some code. What does your HTML look like? Does it use a relative
or absolute URL for the image? What format is your image? What are you
passing in for baseURL?
On 16 Jul 2009, at 16:27, M.S. Hrishikesh wrote:
I am trying to show an image from my Resources directory on a
UIWebView
On 16 Jul 2009, at 17:28, M.S. Hrishikesh wrote:
Forgot to add:
I am accessing the image file like this
NSString *imageName = [[NSBundle mainBundle]
pathForResource:@myImage ofType:@png];
I have confirmed (using NSLog) the path printed in the img tag is
correct
img align=center
Adding file:// to the src tag fixed it.
I also replaces all spaces with %20 (example Application Support
with Application%20Support) but I dont think that matters.
img align=center src=/file://Users/hrishi/Library/Application
Support/iPhone
On 16 Jul 2009, at 09:55, M.S. Hrishikesh wrote:
img align=center src=/file://Users/hrishi/Library/Application
Support/iPhone Simulator/User/Applications/87888BAB-2F9D-44F6-BEB8-
FB7D65D2F1CC/Epicures.app/myImage.png /
Although it may display correctly, that's still not correct. The URI