what is the proper way to set a UIImageView with a UIImage?

Posted by RexOnRoids on Stack Overflow See other posts from Stack Overflow or by RexOnRoids
Published on 2010-03-28T06:27:46Z Indexed on 2010/03/28 6:33 UTC
Read the original article Hit count: 602

Filed under:
|
|
|

I have a UIImageView that starts off with an image (loading.png) specified in IB. When my app starts, a new image is downloaded from the internet to replace the existing one. I do the following to replace the image:

if(object.imageView.image != nil){

[object.imageView.image release];
object.imageView.image = nil;               
}       
object.imageView.image = [UIImage imageNamed:@"downloadedimage.png"];

Is this the right way to re-set an image? I am getting EXC_BAD_ACCESS when doing so.

© Stack Overflow or respective owner

Related posts about uiimageview

Related posts about uiimage