为什么此UIImageView动画会泄漏?
|
使用Leaks运行应用程序时,发现以下泄漏。泄漏发生在分配了“ 0”和“ 1”的位置。我看不到会导致此泄漏的原因。有人可以指出我正确的方向吗?
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];
没有找到相关结果
已邀请:
1 个回复
孝箱捆讨