2012-10-09 96 views
1

我正在创建一个应用程序,其中我正在为Imageview加载800 jpg图像。出现不同的enevts不同的图像集将被加载for animation.on它的第一个事件罚款,但第二次事件它在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; 

而我会越来越崩溃对这些图像集。

+1

把一些代码如何加载图像... –

+0

使用延迟加载使用UITableView。 –

回答

0

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

+0

这应该是一个评论。 –

+0

对不起,我没有足够的声望点评论原始问题。 – mkalmes

+0

hello @mkalmes我的部分代码如下(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];}我碰到这些图像集。 – Mohit

0

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