0

I would like to know how the UIWebView handles images when receiving HTML from a standard NSURLRequest. For instance if I had the following HTML;

<body>
  <!-- header -->
  <header>
    <div class="container">
    <img src="images/logo.jpg" WIDTH="500" HEIGHT="60" alt="pingpong">
    </div>
  </header>

// then the rest of the site (txt, links, more pics etc)
</body>

So considering the HTML above if I were to make the following requests for this HTML like so;

- (void)viewDidLoad {

    NSString *urlAddress = @"http://www.myurl.com";

    //Create a URL object.
    NSURL *url = [NSURL URLWithString:urlAddress];

    //URL Requst Object
    NSURLRequest *requestObj = [NSURLRequest requestWithURL:url];

    //Load the request in the UIWebView.
    [webView loadRequest:requestObj];
}

When 'webView' receives the 'requestObj' via the loadRequest call, how does the webview handle the images found in the HTML?

<img src="images/logo.jpg" WIDTH="500" HEIGHT="60" alt="pingpong">

What does the UIWebView do when it encounters an image like this? how does it get the image data/file etc.?

Carl Veazey
  • 18,392
  • 8
  • 66
  • 81
HurkNburkS
  • 5,492
  • 19
  • 100
  • 183
  • Possible duplicate of [UIWebView loading image using a callback](http://stackoverflow.com/questions/12255923/uiwebview-loading-image-using-a-callback) – Carl Veazey Sep 05 '12 at 22:12
  • No its not, that was asking about callbacks.. UIWebViews do not produce callbacks.. I have done a ton of reading in apple docs and cannot find out how UIWebView retrive the image data, which this question is now referring too. – HurkNburkS Sep 05 '12 at 22:17
  • Sorry, your other question seemed to ask all these questions too. But I can see how they should have been separated anyways. – Carl Veazey Sep 05 '12 at 22:26
  • its all good..Just wish I could figure this out. – HurkNburkS Sep 05 '12 at 22:34
  • I'm curios, what is the problem you are trying to solve that needs understanding of the core flow of the webview ? – A-Live Sep 06 '12 at 00:40
  • I am trying to figure out the best way to present the images in the response. embedded data in the reply or just multiple requests that I think the uiview makes automatically or are there other possibilities.. etc. – HurkNburkS Sep 06 '12 at 00:52

0 Answers0