Question

Will ARC recursively free all properties in a view controller when freed? In other words, when is "nullifying" a property necessary (where ARC will not clean up the memory for you)? It sounds like circular dependencies are one case, but I'm curious if there are other important cases.

Was it helpful?

Solution

As per apple document

Instead of you having to remember when to use retain, release, and autorelease, ARC evaluates the lifetime requirements of your objects and automatically inserts appropriate memory management calls for you at compile time. The compiler also generates appropriate dealloc methods for you. In general, if you’re only using ARC the traditional Cocoa naming conventions are important only if you need to interoperate with code that uses manual reference counting.

The answer to the question

Will ARC recursively free all properties in a view controller when freed? In other words, when is "nullifying" a property necessary (where ARC will not clean up the memory for you)?

As per Apple's document iOS compiler will insert appropriate release / making the property variables nil. So we have to just take care of declaring property variables appropriately e.g., usage of weak, strong etc.

More reference from below links

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top