how to make UIImage as NULL in objective-c

旧城冷巷雨未停 提交于 2019-12-20 07:55:57

问题


I have used the code :
UIImage *selectedImage;

then,

for (int j = 1 ; j <=b ; j++){
        id subView = [self.view viewWithTag:j];

        if ([subView isKindOfClass:[UIImageView class]]){
            ((UIImageView *)subView).image = selectedImage;

then how to make the UIImage as null value.


回答1:


Instead of making UIImage NULL set the Image as Empty Image

[UIImage imageNamed:@""]




回答2:


If you want to simply set your image to null, just do :

yourImage = nil;

If I missunderstood the question or if I'm wrong do not hesitate to let me know. :)



来源:https://stackoverflow.com/questions/46440627/how-to-make-uiimage-as-null-in-objective-c

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!