SomeImage是的UIImageView *全局聲明UIImageView.hidden = NO;但圖像不可見?
-(void)InMethodCalledFromViewDidLoad
{
SomeImage = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"SomeImage.png"]];
SomeImage.frame = CGRectMake(0, 640, 1024,110);
[self.view addSubview:SomeImage];
SomeImage.hidden = YES;
[self OneMoreMethod];
}
-(void)OneMoreMethod{
SomeImage.hidden = NO;//image becomes visible
[self SecondMethod];
/*but now from this point onwards even if SomeImage.hidden changed to NO then only nummerical value of SomeImage.hidden changes but image itself stays hidden doesnt become visible at all */
}
-(void)SecondMethod
{
int tmp = 0;
NSArray* PosAndSizeArrForCurrSlot = [[PosAndSizeArr objectAtIndex:SlotId] componentsSeparatedByCharactersInSet:[NSCharacterSet characterSetWithCharactersInString:@" "]];
for(NSString* values in PosAndSizeArrForCurrSlot)
PositionAndSize[tmp++] = [values intValue];
}
我不能夠理解爲什麼SomeImage甚至沒有SecondMethod被調用後hiiden屬性設置爲NO後可見。
iPad,它的iPad! 確實以大寫字母開頭的變量名稱引起了這種行爲? – Yadnesh
不,名稱不會導致此行爲。 –
iPad處於橫向模式;-) –