UIImageView.hidden property not functioning?
PanelImage is Global allocED and initiated in a method called from ViewDidLoad
PanelImage = [[UIImageView alloc]initWithImage:[UIImage imageNamed:@"panel.png"];
[self.view addsubView:PanelImage];开发者_StackOverflow社区
My image comes up properly but when i try to hide it using
PanelImage.hidden = YES;
it Doesn't hide i test the property using
if(PanelImage.hidden) but i doesnt pass
i also printed it
NSLog(@"panel is hidden %d",PanelImage.hidden);
it outputs "Panel is hidden 0" even after setting it by
PanelImage.hidden = 1;
please help,atleast tell me some technique to debug it. there are lots of methods which are using PanelImage.hidden,it used to work before 2days.now only point where PanelImage.hidden works is the custom initialization function(called from ViewDidLoad) also this is piece of a very big code.
after lots of debugging i came to a point where PanelImage.hidden goes inoperable
PanelImage.hidden = YES;//works till here here
[self GetSymbolAttr];//wont work after this function is called
definition of GetSymbolAttr
-(void)GetSymbolAttr
{
int tmp = 0;
NSArray* PosAndSizeArrForCurrSlot = [[PosAndSizeArr objectAtIndex:SlotId] componentsSeparatedByCharactersInSet:[NSCharacterSet characterSetWithCharactersInString:@" "]];
for(NSString* values in PosAndSizeArrForCurrSlot)
PositionAndSize[tmp++] = [values intValue];
}
as you can see nothing is happening in GetSymbolAttr which will make Pattern.hidden go inoperatble
if PanelImage.hidden = YES;
is now working than you can do its alpha.set to zero . PanelImage.alpha = 0 ;
try this:
UIImageView *PanelImage = [[UIImageView alloc] initWithImage:[UIImage ...]];
[self.view addsubView:PanelImage];
I didn't find initWithImageNamed
method with UIImageView
!
Do you set PanelImage.hidden = YES in the same metod, where you're doing UIImageView *PanelImage = [[UIImageView alloc]initWithImageNamed:@"Panel.png"];? Or haven't you class field with the same name PanelImage?
精彩评论