在UICollectionView中动画gif并在设备上崩溃但在模拟器上没有崩溃时内存泄漏问题

Mob*_*tar 5 iphone memory-leaks objective-c ios

我正在开发键盘应用程序,用户可以输入GIF.Btw GIF可以在键盘上预览,它可以在模拟器和设备上正常工作,我们可以看到GIF动画.但它显示内存泄漏问题,当我们继续滚动时,应用程序在设备中崩溃.我正在使用FLAnimatedImage来显示gif.这是我的源代码.

NSURL *url1 = [[NSBundle mainBundle] URLForResource:[rampageGif objectAtIndex:indexPath.row] withExtension:@"gif"];
NSData *data1 = [NSData dataWithContentsOfURL:url1];
FLAnimatedImage *animatedImage1 = [FLAnimatedImage animatedImageWithGIFData:data1];
cell.imageView.animatedImage = animatedImage1;
Run Code Online (Sandbox Code Playgroud)

这是imageView decleartion.

@property (strong, nonatomic) IBOutlet FLAnimatedImageView *imageView;
Run Code Online (Sandbox Code Playgroud)

有没有人在这方面有经验?任何帮助将不胜感激.

注意:当我们没有为gif设置动画(仅显示静态gif图像)时,不会出现内存泄漏问题,应用程序也不会崩溃.