【发布时间】:2011-04-15 00:44:14
【问题描述】:
在使用 Leaks 运行我的应用程序时,我发现以下泄漏。泄漏发生在分配shimmer 和shimmerAnimation 的位置。我看不出是什么导致了这种泄漏。有人能指出我正确的方向吗?
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];
【问题讨论】:
标签: ios uiimageview core-animation