I was curious to know what the real importance of realeasing objects is, and when it should be done. Also, when you change scene, does it automatically release everything, or are they still in the memory?
Thanks
I was curious to know what the real importance of realeasing objects is, and when it should be done. Also, when you change scene, does it automatically release everything, or are they still in the memory?
Thanks
Well that depends, you should only release object that you own. You own object that you create via alloc
, copy
, mutableCopy
or new
. Releasing them when you don't need them any more is always a good idea.
You should start by reading the memory management documentation apple provides.
But if you are using ARC
than there is no need for you to release object, since this is determent at compile time.
The CCScene on changing will automatically release only it's childs, i mean CCNode subclasses, that you added to it. If you retained any object by code, you must release it in dealloc method
well i am new to objective c but 1 thing i would like to mention is that why bother about allocation or release or retain when apple has provided such an awesome feature called ARC. ARC itself takes care of the memory management issues. so in my opinion all those developers out der jus do d coding n leave d rest to ARC.