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
2010-07-07 10:05:01
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
2010-07-07 11:05:56
See the addition to my answer...
Michael Kessler
2010-07-07 14:33:54
Thank you very much ;)
Claudio
2010-07-07 15:11:29
Is my answer worth marking it as accepted?.. :)
Michael Kessler
2010-07-07 16:38:04
Sorry i had forgotten!!!Done!!
Claudio
2010-07-07 17:19:34