• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Problems displaying an image in UIWebView [solved]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Problems displaying an image in UIWebView [solved]


  • Subject: Re: Problems displaying an image in UIWebView [solved]
  • From: "M.S. Hrishikesh" <email@hidden>
  • Date: Thu, 16 Jul 2009 22:25:33 +0530


Adding "file://" to the src tag fixed it.

I also replaces all spaces with " " (example "Application Support" with "Application Support") but I dont think that matters.

<img align="center" src="/file://Users/hrishi/Library/Application Support/iPhone Simulator/User/Applications/87888BAB-2F9D-44F6-BEB8-FB7D65D2F1CC/Epicures.app/myImage.png" />

Hrishi

On 7/16/09 9:58 PM, 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" src="/Users/hrishi/Library/Application Support/iPhone Simulator/User/Applications/87888BAB-2F9D-44F6-BEB8-FB7D65D2F1CC/Epicures.app/myImage.png" />

Hrishi

On 7/16/09 8:57 PM, M.S. Hrishikesh wrote:
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 simulator). When I copy the HTML string, paste it to a file, and open that under Safari it works fine.

What could be going wrong in the simulator?

Hrishi
_______________________________________________

Cocoa-dev mailing list (email@hidden)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


  • Follow-Ups:
    • Re: Problems displaying an image in UIWebView [solved]
      • From: Andrew Farmer <email@hidden>
References: 
 >Problems displaying an image in UIWebView (From: "M.S. Hrishikesh" <email@hidden>)
 >Re: Problems displaying an image in UIWebView (From: "M.S. Hrishikesh" <email@hidden>)

  • Prev by Date: Re: Problems displaying an image in UIWebView
  • Next by Date: Re: Convention for class name prefixing . . .
  • Previous by thread: Re: Problems displaying an image in UIWebView
  • Next by thread: Re: Problems displaying an image in UIWebView [solved]
  • Index(es):
    • Date
    • Thread