ios - Can't hide UIImageView via setHidden: -


i have custom uitableviewcell in create icon this:

self.icon = [[uiimageview alloc] initwithframe:cgrectmake(15, 15, 50, 50)]; [self.icon setimage:[appearanceproxycontroller getimageforassetidentifier:@"import"]]; [self addsubview:self.icon]; 

which works fine. in addition there method hide icon:

-(void)hideicon{     dispatch_async(dispatch_get_main_queue(), ^{         [self.icon sethidden:true];     }); } 

which ... has no effect @ , have no clue why. method called when cell tapped tableviewcontroller.

the check states hidden not.

uiimageview: 0x17d37d20; frame = (15 15; 50 50); hidden = yes; opaque = no; userinteractionenabled = no; layer = <calayer: 0x17f8f4c0>> hidden: 1 

setting uiimage nil od alpha 0.0 has no effect either. doing wrong?

you have more 1 uiimageview instance, have reference latest one. when hide that, you'll see old instance underneath (if show same image) looks hiding didn't work.

so need make sure call removefromsuperview on old instances or need make sure don't create more one.


Comments

Popular posts from this blog

java - How to specify maven bin in eclipse maven plugin? -

single sign on - Logging into Plone site with credentials passed through HTTP -

php - Why does AJAX not process login form? -