Synyax :

Runtime:addEventListener( “memoryWarning”, handleLowMemory )

Example :

local function handleLowMemory( event )
print( “memory warning received!” )
end

Runtime:addEventListener( “memoryWarning”, handleLowMemory )
———————————
The iOS low memory warning is exposed as a Corona event type named “memoryWarning”, sent to the global Runtime object. This event has no fields.

When this event fires, the OS reserves the right to forcibly shut down the application in about five seconds (although it may or may not do so). Apple advises developers to listen for this warning, and to handle it by freeing as much memory as possible when it is received.
——————————–

Filed under: Corona

Like this post? Subscribe to my RSS feed and get loads more!