0
運行我的應用程序使用泄漏時,我發現以下泄漏。泄漏發生在shimmer
和shimmerAnimation
被分配。我看不到會導致這種泄漏。有人能指出我正確的方向嗎?爲什麼這個UIImageView動畫泄漏?
float duration = .5f;
NSArray *shimmer = [NSArray arrayWithObjects:
[UIImage imageNamed:@"shimmer_1.png"],
[UIImage imageNamed:@"shimmer_2.png"],
[UIImage imageNamed:@"shimmer_3.png"],
[UIImage imageNamed:@"shimmer_4.png"],
[UIImage imageNamed:@"shimmer_1.png"], nil];
UIImageView *shimmerAnimation = [[UIImageView alloc] initWithFrame:[self bounds]];
[UIView setAnimationDelegate:shimmerAnimation];
[UIView setAnimationDidStopSelector:@selector(removeFromSuperview)];
[shimmerAnimation setAnimationImages:shimmer];
[shimmerAnimation setAnimationDuration:duration];
[shimmerAnimation setAnimationRepeatCount:1];
[shimmerAnimation startAnimating];
[self addSubview:shimmerAnimation];
[shimmerAnimation release];
哇,把我放在我的地方。謝謝! – 2011-04-14 17:04:43