Can I update PlayerPrefs when iOS app triggers a memory warning

I would like to be able to check at the time when I’m about to load a level if the app has received a memory warning; is that doable?

You have to modify the AppController.mm file to get a message. Check here for an explanation:

http://forum.unity3d.com/threads/145269-Is-there-a-way-to-tell-in-Unity-when-onDidReceiveMemoryWarning-is-received

Here’s my C# code:

using UnityEngine;
using System.Collections;

public class LowMemoryManager : MonoBehaviour
{
	//Function is called when a lowMemoryWarning is received
	public void ReceivedMemoryWarning(string message)
	{
		Debug.Log("Low Memory Manager RECEIVED LOW MEMORY WARNING!");
		Resources.UnloadUnusedAssets();
		Prefs.Save();
	}
}

You don’t have to modify AppController.mm anymore. See the last answer here: Is there a way to tell in Unity iOS when onDidReceiveMemoryWarning is received? - Questions & Answers - Unity Discussions

 #import "UnityAppController.h"
 
 @interface MyOwnAppController : UnityAppController {}
 @end
 
 @implementation MyOwnAppController
 - (void)applicationDidReceiveMemoryWarning:(UIApplication*)application {
     printf_console("WARNING MY OWN APP CONTROLLER -> applicationDidReceiveMemoryWarning()

");
}
@end

 IMPL_APP_CONTROLLER_SUBCLASS(MyOwnAppController)