开发者

how to get imageview nil checked in iphone

hi I have a UIImageView(reimg1开发者_运维技巧),while loading it for the first time i should not have any image so i will make the image nil.

if (reimg1.image == nil) {
   NSLog(@">>>>>>>> image view is empty");
} else {

}


check if(image==nil) or set some default image when image is empty


See UIImage.image.


if you want to set image nil first time then set property like this

[self.reimg1 setImage:Nil];  

if u wan tto check means whether it has data in it

if(reimg1==nil)  
{  
..  
}  

or else convert NSdata and check its values


Checking if an imageView is empty.

if ([imageView isEqual:nil]) {

    //if the image view is empty do the following
    NSLog(@"imageView:%@ is empty", imageView);


}else{

    //If the image view is not empty do the following
    NSLog(@"imageView:%@ is not empty", imageView);

    //For example, in viewDidLoad, you could set UIImageView as nil
    [imageView setImage:nil];

}
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜