views:

57

answers:

1

In my app i insert images in the tableview by putting the url of image in the field image of xml!! It's possible insert the entire image directly in XML, including in the field image, instead of the URL, a kind of image compression, for example, the bits that make up the image.

A: 

This will increase the loading time a lot!

Search for a solution for "lazy loading" on the Web.

This is the most common approach for loading images in the table views on iPhone...


EDIT:
If you still want to use blub (image data as text inside the XML) then you might use the next code sample:

NSData *imageData = [NSData dataWithBase64EncodedString:imageString];
UIImage *image = [UIImage imageWithData:imageData];
Michael Kessler
I need all the images are downloaded once at startup so i can use offline.My idea is to insert the binary image directly in XML, save the XML in documents at start of app and then parse the xml and convert the binary image in real image! I have no idea how to do this!I read on internet that the images can be converted to arrays of bytes and then I thought of using the method dataWithBytes!What do you think??
Claudio
See the addition to my answer...
Michael Kessler
Thank you very much ;)
Claudio
Is my answer worth marking it as accepted?.. :)
Michael Kessler
Sorry i had forgotten!!!Done!!
Claudio