Placeholder image when there is no connectivity to load image with web service
can we get any dummy image when internet connection(or no web services available) is not there ?when we have internet connection i mu开发者_StackOverflow社区st retrieve image from the web services....
Why not just have a default image in your project that you load up if you cannot get one from the web service. I am not sure how you are opening the connection. If you are getting some sort of data back from a connection do something like this:
UIImage *theImage;
if(imageData > 0)
theImage = [UIImage imageWithData:imageData]
else
theImage = [UIImage imageNamed:@"whateverYourDummyImageNameIs.jpg"];
It really depends on how you are retiriving the image. When your service finishes, just check to see if you have any data; if yes, save the image. If no, load the dummy image.
精彩评论