gpt4 book ai didi

ios - 播放一次 UIImageView 动画并在播放后立即将其从内存中删除的最佳方法是什么?

转载 作者:行者123 更新时间:2023-11-29 11:19:57 25 4
gpt4 key购买 nike

我很难从内存中删除我的动画。执行此操作的最佳方法是什么?

这是我的动画代码:

-(IBAction)animationOneStart { 

NSMutableArray *images = [[NSMutableArray alloc] initWithCapacity:88];

for(int count = 1; count <= 88; count++)
{
NSString *fileName = [NSString stringWithFormat:@"testPic1_%03d.jpg", count];
UIImage *frame = [UIImage imageNamed:fileName];
[images addObject:frame];
}

loadingImageView.animationImages = images;

loadingImageView.animationDuration = 5;
loadingImageView.animationRepeatCount = 1; //Repeats indefinitely

[loadingImageView startAnimating];
[images release];

}

谢谢!

最佳答案

[images removeAllObjects];
[images release];

关于ios - 播放一次 UIImageView 动画并在播放后立即将其从内存中删除的最佳方法是什么?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/7789407/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com