My app contains some images which needs to be dynamically loaded from web server through XML file. Every time when changes done in admin console at web server it should reflect in iPhone app too through the XML file. I wrote XML file but dont know how to get used in iPhone code. I referred the following links,
how-to-retrieve-data-through-xml-in-iphone-locally-file
dynamically-pulling-images-from-xml-for-iphone-app
how-to-change-the-tabbaritem-images-dynamically-in-iphone-app
retrieving-images-to-iphone-app-through-xml
but all these links are not clear for me to understand. Kindly suggest me a way to do it.
So I assume your web server can serve an XML which includes the image in some encoded format like base64. Then you need to:
NSURLConnection, e.g. as described in how-to-make-http-request-from-iphone-and-parse-json-resultNSStringand you want to have its binary representation asNSData.NSDatahas some convenience functions for this. E.g. for base64, there is thedataFromBase64String:constructor.UIImageusing theimageWithData:constructor.UIImageViewand assign to it yourUIImage. Set the frame of the view and add it to your preferred subview.It is also possible that the XML provides URLs where to get the image data. Then you have to do a new request. This should be clear by now, how to do.
Good luck.