我有一个下载图像的对象......当完成图像时,调用方法 finishLoad 来保存这个图像......我的 UIViewController 中有这个对象的列表,我想知道这个方法多少次被调用,当这个计数 = 10 时,我将调用另一个方法。我该怎么做?
@implementation DownloaderImage
{
- (void)finishLoad {
//:: hide default image ::
[self setImage:nil];
//:: fade in in loaded picture ::
[UIView beginAnimations:nil context:NULL];
[UIView setAnimationDuration:0.5];
CGAffineTransform myTransform = CGAffineTransformMakeTranslation(0, 0);
[finalImage setTransform:myTransform];
finalImage.alpha = 1.0;
UIImage *scaledImage = [finalImage.image scaleToSize:CGSizeMake(320.0f, 345.0f)];
finalImage.image = scaledImage;
//:: fade out background picture ::
[backgroundImage setTransform:myTransform];
backgroundImage.alpha = 0.0;
[UIView commitAnimations];
}
}