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:
parent
d2dc4cbbac
commit
dffff12607
|
@ -28,6 +28,10 @@
|
|||
{
|
||||
cachedImage = [manager imageWithURL:url];
|
||||
}
|
||||
else
|
||||
{
|
||||
self.image = placeholder;
|
||||
}
|
||||
|
||||
if (cachedImage)
|
||||
{
|
||||
|
|
Loading…
Reference in New Issue