If nil is given as URL to setImageWithURL:, set the image to the placeholder image (or nil if no placeholder)

This is the recommanded way clear an image for reuse (as a UITableViewCell for instance). Calling setImageWithURL:
with nil URL will have the effect to cancel an eventual currently in progress download of a thumbnail for this UIImageView.
Affecting the image property directly won't have this effect and may lead to image being re-affected once download is completed.
This commit is contained in:
Olivier Poitrey 2010-09-16 13:01:14 +02:00
parent d2dc4cbbac
commit dffff12607
1 changed files with 4 additions and 0 deletions

View File

@ -28,6 +28,10 @@
{
cachedImage = [manager imageWithURL:url];
}
else
{
self.image = placeholder;
}
if (cachedImage)
{