Memory Leakage

Variables

Set all variables to nil, as they will continue to live on in the device memory, taking up valuable space. Wasting it.

Objects

Remove all objects from the device memory as they will continue to take up space in the device’s memory. Wasting it.

When to declare these actions?

For objects that are visible to the human eye or placed on the screen canvas. You need to ensure they are removed after the scene goes off-screen, else it will appear as if the objects just suddenly vanish. Nasty user experience.

Variables, need to be emptied (set to nil) as soon as they are not required anymore. If unsure, set in the hide or destroy scene events.

Leave a Reply