Iphone 加载大量图像时崩溃

Iphone 加载大量图像时崩溃,iphone,Iphone,我正在创建一个应用程序,其中我正在为Imageview加载800个jpg图像。在发生不同的事件时,将加载不同的图像集进行动画。在第一个事件发生时,它工作正常,但在第二个事件发生时,它在iPhone上崩溃。有什么帮助吗? 我的代码部分如下 for (int aniCount = 1; aniCount < 480; aniCount++){ UIImage *frameImage = [UIImage imageWithContentsOfFile: [[NSBundle mainBundl

我正在创建一个应用程序,其中我正在为Imageview加载800个jpg图像。在发生不同的事件时,将加载不同的图像集进行动画。在第一个事件发生时,它工作正常,但在第二个事件发生时,它在iPhone上崩溃。有什么帮助吗? 我的代码部分如下

for (int aniCount = 1; aniCount < 480; aniCount++){
UIImage *frameImage = [UIImage imageWithContentsOfFile: [[NSBundle mainBundle] pathForResource: [NSString stringWithFormat: @"ani_soft_whimper_%i", aniCount] ofType: @"jpg"]];
[_arr_ImagesSoftWhimper addObject:frameImage];
}
imageView.animationImages = _arr_ImagesSoftWhimper;
for(int-aniCount=1;aniCount<480;aniCount++){
UIImage*frameImage=[UIImage imageWithContentsOfFile:[[NSBundle mainBundle]pathForResource:[NSString stringWithFormat:@“ani_soft_呜咽器%i”,aniCount]类型:@“jpg”];
[_arr_ImagesSoftWhimper addObject:frameImage];
}
imageView.animationImages=\u arr\u ImagesSoftWhimper;

这组图像正在崩溃。

可能是内存不足。但这只是一个猜测。请提供一些代码。

1.如果您从任何服务器下载,请调用异步调用。
2.根据uiimageview框架检查图像尺寸,如果尺寸较大,请首先调整或裁剪图像,然后设置为uiimageview。

输入一些代码如何加载图像…使用UITableView延迟加载。这应该是一个注释。抱歉,但是我没有足够的声望来评论最初的问题。hello@mkalmes我的部分代码如下(int-aniCount=1;aniCount<480;aniCount++){UIImage*frameImage=[UIImage-imageWithContentsOfFile:[[NSBundle mainBundle]pathForResource:[NSString-stringWithFormat:@“ani-soft\u-whimper\u%I”,aniCount]类型:@“jpg”];[\u arr_ImagesSoftWhimper addObject:frameImage];}我发现这些图像集崩溃了。代码是用ARC编译的吗?它到底在哪里崩溃的?崩溃报告的措辞是什么?