Total Pageviews

Monday, May 26, 2014

Event MemoryWarning

Event MemoryWarning
សំរាប់ MemoryWarning មានតែលើ iOS ទេ។ សំរាប់ iOS low memory warning is exposed ដូចជា Corona event type named “memoryWarning”បញ្ជូនទៅកាន់ Runtime object។ សំរាប់ event នេះមិនមាន field ទេ។ នៅពេលដែល event fires ពេលនោះ OS reserves the right to forcibly shut down the application in about 5 seconds
Syntax: runtime:addEventListener (“memoryWarning”, listener)
Listener(តំរូវការ) វាជា Listener ដែល event listener to be notified នៅពេលដែល low memory situation កើតឡើង

នេះជា Property របស់វា
Properties
event.name
វាមានតំលៃជា String “memoryWarning”
សូមមើលកូដះ

local function handleLowMemory( event )
    print( "memory warning received!" )
end
Runtime:addEventListener( "memoryWarning", handleLowMemory )


No comments:

Post a Comment