Is it possible to debug "Terminated due to memory error"?

Santa Claus picture Santa Claus · Oct 6, 2013 · Viewed 88.5k times · Source

In a certain (consistent) point when my app is running, I consistently get the xcode error message

Terminated due to memory error.

I cannot find the code causing the error, but I can tell what code is near the error (using breakpoints).

The error is caused directly after returning a certain cell in my implemenation of the

- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath

UITableViewDataSource delegate method. I can confirm that it is returning a valid UITableViewCell, but I think that explaining and posting that entire method would be a waste of your time. However, I suspect it might be caused by a rapid, massive allocation of memory.

It definitely says Terminated due to memory error, not memory pressure.

I would like to know what is message really means. Also, is there any way to debug this message? No crash report is generated.

I am using ARC and iOS 7.

Answer

zirinisp picture zirinisp · May 19, 2014

I was getting this error and could not understand what was wrong.

After some searching I found out that i forgot to disable zombies.

To disable do the following:

Select edit scheme

Deselect "Enable Zombie Objects