Application error due to out of memory

Instruments app

I have an Instagram-like application with an endless feed and camera. I am using ARC . I use AFNetworking to download (and cache) images.

When I scroll through a channel, it allocates and allocates a lot of memory, sometimes it is released. Therefore, if my application takes up more than 10-13 mb, and I open the camera, it crashes. My feed is an NSMutableArray consisting of the following objects:

 @interface Post : NSObject @property (readonly) NSString *postId; @property (readonly) NSURL *imageURL; @property (readonly) NSString *text; @end 

What am I doing wrong? And what should I do in the doreceivememorywarning method?

+4
source share
1 answer

When you get didReceiveMemoryWarning, you can get rid of any resources that you can recreate.

 - (void)didReceiveMemoryWarning { [self setBackBtn:nil]; [self setDataSource:nil]; [self setPendingDataSource:nil]; [self setSelectionView:nil]; [self setTitleForFormBarButtons:nil]; [self setType:nil]; [super didReceiveMemoryWarning]; } 
0
source

All Articles