누수를 사용하여 내 응용 프로그램을 실행할 때 다음과 같은 누설을 발견했습니다. 누수는 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];
와우, 내 자리에 넣어. 감사! –