tags:

views:

42

answers:

2

I m trying to Retrieve the data from XML File into an IPhone application.

The XML File Which i used is :

<note>
  <heading>Reminder</heading>
  <body>Don't forget me this weekend!</body>
  <URL>http://192.168.1.75/one.png&lt;/URL&gt;
</note>

In this XML I have retrieve the text but i failed to display the image from the link in the XML File.

Please Help me to Solve this Problem!!!

A: 

So your looking to load the URL into an image?

This should do the trick. (Untested code btw.)

NSURL *url;
NSData *data;
UIImage *image;

url = [NSURL URLWithString:xmlURL];
data = [[[NSData alloc] initWithContentsOfURL:url] autorelease];
image = [UIImage imageWithData:data];

// do something with the image
Brad Goss
A: 

Hi Brad,

Thanks for your response.... We tried with your code snippet, but still facing some issues in retrieving the image and displaying it on the app...

There is no error that is displayed but image is not getting displayed.

Jenifer