views:

46

answers:

1

Hi guys,

In my iPhone application I'm parsing RSS feed to get html and keep it. Afterwards I display this html in UIWebView. The problem is that html contains urls of images, if there is network connection everything is ok, UIWebView loads and displays these images, but if there is no connection it shows text but in place of images shows frame with blue square inside

How can I get rid of it? Thank you

+1  A: 

Check programmatically to make sure that you have an internet connection.

See this question and its accepted answer on how to do that.

If you don't have an internet connection, then you have a couple of options. You can either:

  1. Parse through your html, replace the <img> tags with blanks (this will completely get rid of the images and their associated blue question mark boxes.
  2. Parse through your html, replace the src part of <img src="somewebsite"> with a reference to an image placeholder in the project bundle.

XPath is your friend when it comes to parsing html. Although if you wanted to, you could do all of this with NSSTring.

Andrew
Ok, thanks, I solved my problem))
Burjua