I have a uitableview which stores one image in one cell. Its image get loaded from internet. The problem is the application get slow till its image get loaded from internet. So I want to put a mechanism that it first get loaded with a default image and when it gets the original then the default image will be replaced by the original one.
Give me any tutorial or any sample code for it.
Thanks in advance.
Get your image trough some other thread …. and use notification or delegate to keep track of any change in image download … suppose you are using notification …. then in class which you set as observer for that notification reload the data of tableView …. so your table image will get updated where there was so default image …. for more detail lets take an example ….. Make a operation class to downloading the image we call it thumb …. In this example I make 2 classes
1.
PhotoGalleryVCwhich shows a list of thumbs and some detail of each thumb and2.
LoadGalleryThumbOp[Op = operation] downloads thumbs and post notification when donein LoadGalleryThumbOp.m do it as
this class will download the image you wanted and will call its delegate when the image is download ..
Now comes its use part in
PhotoGalleryVCuse it like thisin .m part
finally the method which is called when a particular image is downloaded
woooh…..! thats a lot of code for one example
Note : I cut out so many line so this code may not work for u directly {there may be so many errors .. }, But i hope you get the main idea behind the scene … 🙂