Memory leak error during gif animation in UICollectionView and device crash, but not crash on the simulator

I am developing a keyboard application and the user can enter a gif. Btw gifs are viewed on the keyboard, it works great with the simulator, and also on the device, we see that gifs come to life. But this indicates a memory leak problem, and when we continue to scroll, the application gets a failure in the device. I am using FLAnimatedImage to display a gif. Here is my source code.

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; 

Here's the imageView decleartion.

 @property (strong, nonatomic) IBOutlet FLAnimatedImageView *imageView; 

Does anyone have experience in this area? Any help would be appreciated.

Note. If we do not animate gifs (only a static gif image is shown), a memory leak problem does not appear and the application does not crash.

+5
source share

All Articles