如何檢測UIImageview
是否已更改,以及如何在顯示圖像時顯示NSLog
?這裏是我的代碼:監控UIImageView的圖像屬性更改
-(void)changePhotoStatus
{
NSArray *myArray = [NSArray arrayWithObjects:[NSString stringWithFormat:@"FasterText.png"],[NSString stringWithFormat:@"Don'tTouchText.png"],nil];
fasttext.image = [UIImage imageNamed:[myArray objectAtIndex:arc4random() % [myArray count]]];
if (fasttext.image == [UIImage imageNamed:@"Don'tToucText.png"]) {
NSLog(@"cahn");
}
}
我使用NSTimer
來調用圖像的更改。但不會出現NSLog
。請幫助。
仔細檢查你的nstimer代碼。或發佈它 –