我正在使用 UIImage 动画,它会导致使用该应用程序的不同用户出现大量内存泄漏和崩溃。
下面是我的代码。我在 viewDidAppear 中预加载了两个动画
pointsView.image = [UIImage imageNamed:@"C72.png"];
NSMutableArray *menuanimationImages = [[NSMutableArray alloc] initWithCapacity:21];
NSString *imageName;
for( int aniCount = 0; aniCount < 72; aniCount++ )
{
imageName = [NSString stringWithFormat:@"C%d.png", aniCount];
[menuanimationImages addObject:[UIImage imageNamed:imageName]];
}
pointsView.animationImages = menuanimationImages;
pointsView2.image = [UIImage imageNamed:@"I72.png"];
NSMutableArray *menuanimationImagess = [[NSMutableArray alloc] initWithCapacity:21];
NSString *imageNames;
for( int aniCounts = 0; aniCounts < 72; aniCounts++ )
{
imageNames = [NSString stringWithFormat:@"I%d.png", aniCounts];
[menuanimationImagess addObject:[UIImage imageNamed:imageNames]];
}
pointsView2.animationImages = menuanimationImagess;
}
然后我正在使用运行动画
pointsView.animationDuration = 3.11;
pointsView.animationRepeatCount = 1;
[pointsView startAnimating];
有什么建议么?