How to make didReceiveMemoryWarning be called under an ARC application

I heard that didReceiveMemoryWarning will most likely be called when you are appropriately leaked. However, in ARC, I always thought that the allocated local variables would be deleted after we passed the block in which they were created. Were these leaks for all properties?

I am trying to create the correct recovery if didReceiveMemoryWarning is called in my application, but so far I have not been able to see it. I am looking for help in understanding when this will be called, and should these leaks be properties against local variables (under ARC)?

+4
source share
1 answer

Just use the "Simulate memory" command in the "Equipment" menu of the simulator.

If you want to do this by code, you can use the following code (note that it is closed , so you need to remove it for AppStore releases, it is just useful for debugging)

[[UIApplication sharedApplication] _performMemoryWarning];

Both of these procedures repeat what happens when the device is in a low memory situation, so the didReceiveMemoryWarning methods will be launched.

+4
source

All Articles